-
Notifications
You must be signed in to change notification settings - Fork 235
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
More than 10 requests at the same time fail! #66
Comments
It would be helpful to see how you're orchestrating these calls (also syntax highlight code with GitHub Flavored Markdown please). |
Hi. I have updated my original post. On the first POST I get the 1st document and on the second POST the 2nd associated document. |
Can you post the full stacktrace of your error? |
Hello. I added the console.trace. |
Is it possible there's a race condition at work and you're actually running up against the per-host maxSockets limit of 5? Are you handling errors and determining success using needle.post(URL, DATA, populateList); |
Hi. As you said I am determining success using For the part about |
It's not a server property. It's something the Node agent proposes but you can override. See the node docs link above. Re: referencing functions vs. passing the literal in directly, the idea is that they're exactly identical. Just saves you a little verbosity. I'd consider the way you're aggregate results to be an anti-pattern. You should be using some sort of async pattern to handle that logic (i.e. the aggregate operation should fail if a single member fails). I like promises. They're a more robust abstraction but also require some effort to properly understand. You can also try async for something simpler. Try running all 10 operations in sequence so only one socket is open at any given time. Based on the stack trace this almost certainly isn't a needle issue. |
Unfortunately it will take me some time to rewrite that part so instead I am going to use elasticsearch.js in order to make the calls. Already tried it and it works as expected. Thank you for the help guys. |
Hello. I am trying to make 10 simultaneous POST requests to get some data from ElasticSearch
and on the 9th and 10th request I always get this error:
The other 8 requests are totally fine.
Do you happen to know the solution to this issue?
The text was updated successfully, but these errors were encountered: