1

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

2
  • What OS are you running the server on? Jun 5, 2014 at 18:56
  • Edited to add operating system.
    – jjmerelo
    Jun 6, 2014 at 5:16

1 Answer 1

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.

3
  • So you think it should be fixed at the operating system level instead of the node.js level?
    – jjmerelo
    Jan 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.
    – jjmerelo
    Jan 29, 2014 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.