Node: 100s of simultaneous requests significantly slows down the server. OS question?

The node application makes requests to two servers, A and B. To server A, it waits for one request to complete before making the next one. For server B, it makes 20 requests per second without waiting. When I make requests to server B, requests to server A are very time consuming. When I do not make requests to server B, they go quickly. Requests to server B accumulate, but at the same time no more than a few hundred.

I am running the same application with the same version of node on an instance of Joyent smartos, and I do not have this problem, so I assume that this is a problem with the restrictions that the operating system sets, and not with the limits set by node. In node, I have maxSockets set to 10000, as described here, http://markdawson.tumblr.com/post/17525116003/node

I run my application with an upstart, although I don’t know if I have a problem without it (this will be my next test). In my upstart configuration file, I have a limit of nofile 90,000 90,000. There are some other restrictions that I can raise, as described here, http://upstart.ubuntu.com/wiki/Stanzas#limit , but I don’t know what they make. Can one of them cause a problem? Where else can the Ubuntu machine limit be set?

I must add that I run the upstart program through Monit in case it is relevant.

+4
source share
1 answer

, ServerA ServerB, Node HTTP- (//). http.globalAgent.maxSockets = 20; , , .

/ ... /proc/sys/fs/file-max

linux/Documentation/sysctl/fs.txt:

file-max file-nr:

, .

-max , ​​Linux. , , .

-nr , , . Linux 2.6 0 - , , .

, -, printk, " VFS: ".


, Ubuntu, ufw () / iptables, .

0

All Articles