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
Asked
Active
Viewed 1,368 times
1

jjmerelo
- 22,578
- 8
- 40
- 86
-
What OS are you running the server on? – Chris Tavares Jun 05 '14 at 18:56
-
Edited to add operating system. – jjmerelo Jun 06 '14 at 05:16
1 Answers
2
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.

Community
- 1
- 1

hereandnow78
- 14,094
- 8
- 42
- 48
-
So you think it should be fixed at the operating system level instead of the node.js level? – jjmerelo Jan 29 '14 at 17:23
-
yes, queuing http-requests inside code just seems to be wrong (at least in my opinion) – hereandnow78 Jan 29 '14 at 19:15
-
but queuing is not done explicitly, but implicitly by the node.js interpreter, which is single threaded. – jjmerelo Jan 29 '14 at 19:46