Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashing on sending push to all users #1662

Closed
candork opened this issue Apr 28, 2016 · 7 comments
Closed

Crashing on sending push to all users #1662

candork opened this issue Apr 28, 2016 · 7 comments

Comments

@candork
Copy link

candork commented Apr 28, 2016

I have around 300k users on my parse app. After trying to send push from the dashboard, the server crashed. Looks like its running out of memory, any hints on how to solve it?

Thanks!

Here are the logs

verbose: POST /parse/push { host: 'localhost:1337',
  connection: 'keep-alive',
  'content-length': '237',
  origin: 'http://0.0.0.0:4040',
  'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36',
  'content-type': 'text/plain',
  accept: '*/*',
  referer: 'http://0.0.0.0:4040/apps/parseapp/push/new',
  'accept-encoding': 'gzip, deflate',
  'accept-language': 'en-US,en;q=0.8' } {
  "where": {},
  "data": {
    "alert": "test"
  }
}
verbose: {
  "headers": {
    "X-Parse-Push-Status-Id": "qMkeE3BVa0"
  },
  "response": {
    "result": true
  }
}

<--- Last few GCs --->

  152472 ms: Mark-sweep 1386.1 (1457.9) -> 1394.1 (1457.9) MB, 1856.4 / 0 ms [allocation failure] [GC in old space requested].
  154362 ms: Mark-sweep 1394.1 (1457.9) -> 1394.7 (1457.9) MB, 1889.6 / 0 ms [allocation failure] [GC in old space requested].
  156230 ms: Mark-sweep 1394.7 (1457.9) -> 1385.1 (1457.9) MB, 1867.7 / 0 ms [last resort gc].
  158107 ms: Mark-sweep 1385.1 (1457.9) -> 1386.0 (1457.9) MB, 1877.3 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x3bc143fe3ac1 <JS Object>
    1: untransformObject [/Users/r/Documents/r/parseapp/Dev/app/Backend/parse-backend/node_modules/parse-server/lib/Adapters/Storage/Mongo/MongoTransform.js:~629] [pc=0x29ec8acc8e0] (this=0x1f987c184911 <an Object with map 0x10fad3e3be69>,schema=0x15115fb97e11 <a Schema with map 0x1cd3aeaf0e29>,className=0x27561321f2a9 <String[13]: _Installation>,mongoObject=0x688afe44731 <an Objec...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
Abort trap: 6
Rashids-iMac:parse-backend r$ 
@Salakar
Copy link

Salakar commented May 4, 2016

I think parse-server needs to be chunking and yielding to the event loop on this, background-compute is a good example.

Looks like its the deserialisation from the mongo transform. Similar issue on the sails-mongo adapter: balderdashy/sails-mongo#369 but this is more of a blocking event loop issue.

@drew-gross
Copy link
Contributor

Parse Server push isn't designed for high throughput, so with 300k users, you will need a lot of memory to push to all of them. Some workarounds might be to use another push provider (Urban Airship, Facebook analytics push, One Signal) or to increase the memory on your instance before sending a push, or to send pushes to smaller batches of users.

@Jinoooo
Copy link

Jinoooo commented Jun 13, 2016

I also faced the same issue when trying to send push to 30k users (all users). I had to increase the memory limit 10 time more to fix the issue :(

@candork
Copy link
Author

candork commented Jun 13, 2016

@Jinoooo how did you increase the memory issue?

@Jinoooo
Copy link

Jinoooo commented Jun 13, 2016

Just increased the allocated memory on AWS hosting server. Wondering how parse.com is addressing this issue. Any plan to fix this roadblock?

@Jinoooo
Copy link

Jinoooo commented Jun 13, 2016

You can also change your code to send it to a smaller group based on your memory limit. In your case for 300K, you may need to break it to 10k bucket each time and repeat the process 30 times, ugly I know.

@hramos
Copy link
Contributor

hramos commented Jul 27, 2016

We're closing this issue due to inactivity.

If this is a bug you care about that is not getting attention, consider opening a pull request with a fix.

@hramos hramos closed this as completed Jul 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants