I'm using a very simple express
server, with a PUT and GET routes on an Ubuntu machine, but if I use several clients (around 8) doing requests at the same time it very easily gets flooded and starts to return connect EADDRNOTAVAIL
errors. I have found no way to avoid this other than reducing the number of requests per client, but is there a way to throttle answers on the server so that instead of returning error it queues petitions and serves them in due time?
Maybe it's better to check whether there are answers to requests on the client and not insert new ones if they have not been served? Client is here
-
What OS are you running the server on?– Chris TavaresJun 5, 2014 at 18:56
-
Edited to add operating system.– jjmereloJun 6, 2014 at 5:16
Add a comment
|
1 Answer
Queuing seems to be wrong, you should first check your current ulimit (every connection needs a handle).
To solve your problem, just change the ulimit.
-
So you think it should be fixed at the operating system level instead of the node.js level?– jjmereloJan 29, 2014 at 17:23
-
yes, queuing http-requests inside code just seems to be wrong (at least in my opinion) Jan 29, 2014 at 19:15
-
but queuing is not done explicitly, but implicitly by the node.js interpreter, which is single threaded.– jjmereloJan 29, 2014 at 19:46