-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Large number of targeted Installations make the servers failed (499 errors) #123
Comments
anyone here? |
Hi @SebC99 Not an issue I have run into personally. Given the large number, can you use a queue and send them in smaller batches? |
Why not, but I honestly don't know how do use this kind of queue ;) |
Have you tried PARSE_SERVER_ENABLE_EXPERIMENTAL_DIRECT_ACCESS=1? I recently hit max open file (TCP connection) on a completely separate issue. Do you know where your connections are coming from / going to? |
I don't know what the batch size should be. for large pushes, ideally, you could parallelize @flovilmart looked into this in the past and I wrote https://github.com/parse-community/parse-server-sqs-mq-adapter, but i never used it. |
@dplewis what do you mean? It's just the push adapter emits too many connections I guess so there is no room for any other requests. The batch feature of the adapter for identical payload doesn't seem to work... But it's very hard to understand the push and queue code ;) |
I understand that the problem is not about sending the pushes. It seems that the pushes are successfully sent, right @SebC99 ? Can you observe in the push status if they are all sent? What I saw sometimes is: the pushes are successfully sent but, as the clients receive them, they hit back the parse api and it makes the server to crash. Since you are noticing the worker_connections error in nginx, it might be the problem. I see two possible solutions:
|
@davimacedo not at all!! Only a very small number are sent, like 5000 |
What is the status you see in your push status? Sending forever? How are you running your parse server process? Is it a docker container? A service? Have you noticed this process crashing when sending the pushes? |
Have you tried batchSize < 5000 ? |
Here's what is in the DB for the last try
|
@SebC99 This is what I was talking about parse-community/parse-server#4173 With direct access there isn't any overhead but now that it uses HTTP interface that opens another connection. I think that's where your issue is coming from. |
Thanks, I haven't noticed that one, I'll give it a try (direct access has failed me before for cloud functions, so I haven't try for push yet) |
Ignore that last comment looks like that has been updated. I don't know much about the push and queue code. I can try to run it locally and see what's causing the issue. I think is similar to what @davimacedo mentioned, something might be hitting the Parse API. |
I'll try to investigate too. |
After some tests,
BTW, I understand numSent and numFailed values, but what is the count value? |
And with VERBOSE, I can clearly see: I have the exact same error with batchSize set to 10 than batchSize set to 5000. |
I also noticed this weird error from node-apn: |
If it helps, I keep testing things:
|
If you look here promises are serialized. Maybe do something similar to parse-community/parse-server#5420 to prevent a bottleneck. Enqueue by PushStatusId or pushStatus.objectId |
@SebC99 You said that it is much better without payload and that's interesting. I am wondering if the problem is the whole payload. Can you please try without sending "alert-fr":{"title":"XXXX","body":"XXXX"}, in the payload? I am wondering if the problem is related to the locale feature. BTW, count is total pushes that should be sent, sent is how many succeeded and failed is how many failed. Ideally count should be sent + failed. In your case, the status is "sending" forever. It uses to happen when some of your batches failed to send due to a server crash (and will never be sent again). Because of this, sent + failed is always < count and the status never changes. The 3 most common reasons that I've seen to make it happen:
Would you be able to observe if some of these are likely to be happening? |
@davimacedo I tried with a simple "alert" payload (not localized) and I do have the exact same thing.
|
@SebC99 Thank you for providing detailed feedback. We have a general idea and suggestions on where the issue may be coming from. Would you like to take a look at the serialized promises I pointed out #123 (comment) and submit a fix? |
Hello,
We want to be able to send a push request to all our users in an area (more than 100k) but it fails the servers with far too many connexions (nginx 1024 worker_connections are not enough) and all the standard requests to the servers end up with 499 errors.
Our Parse servers are on Elastic Beanstalk, and we use a simple query
new Parse.Query("Parse.Installation").exists("deviceToken")
in theParse.Push.send
method.The text was updated successfully, but these errors were encountered: