We make a high volume of requests over http between components in our 
system, and running into what seems to be a connection pooling issue that's 
difficult to track down.

As far as I can tell, connection pools in Node are managed by a globalAgent 
(global to the Node process). The underlying TCP connections are 
established by the net module, which is used by the http module. I would 
expect that as soon as each request is resolved, the TCP connection that 
handled the request is available and can be reused.

Instead however, the request handled by each connection up to the max # of 
connections (set on globalAgent.maxSockets) is resolved before any queued 
requests are handled.

So if we set maxSockets to 10, we see 10 requests resolve 
successfully. Then there is a pause, while new tcp connections are 
established. Then 10 more requests resolve. Then a pause while connections 
are closed/re-established. Etc.

This feels wrong. Node is supposed to excel at handling a high volume of 
concurrent requests. If request 1000 cannot be handled until 1-999 resolve, 
everyone who has ever used Node for anything would run into this 
bottleneck. Yet I can't work out what we're doing incorrectly.

Any suggestions?

Thanks!

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to