-
Notifications
You must be signed in to change notification settings - Fork 7.3k
'hard' backlog limit of 128 #1496
Comments
Thanks, this is under consideration. The backlog is a no-op on modern linux systems but I know freebsd honours it. We're probably going to expose |
For what it's worth backlog is also not a no-op on SunOS based stuff. |
I'm going to mark this as low-priority because of the OS support. We'll revisit after 0.6 drops. |
Actually on all versions of the linux kernel the backlog is no no-op at all. I did some looking around and found the backlog parameter to The current setting of 128 will actually make the backlog 256 entries big, which is a bit on the small side I think. I suggest setting the default to 511 (like nxing, redis, apache) and modifying the
since neither |
@erikdubbelboer: Sure, I would like a PR. |
I made a pull request: #3130 The way I changed it isn't backwards compatible with the _backlog variable. But since this was internal and never really documented I see no harm in that. |
Fixed in 3d69bbf. |
The backlog parameter was removed from the HTTP module (or more likely form Net, and inherited by HTTP) some time before Node.js v2 in favor of a hard-coded value of 128.
In terms of load handling, this value limits the maximum size of the listen queue for the server's socket. On BSD systems,
netstat -Lan
shows the queue status of all sockets in the LISTEN state. Node will limit it's queue size to 128 even if the OS limit is larger. This cause BSD and Windos (Cygwin) OSs (and possibly some Linux systems) to begin to reset incoming TCP requests at loads as low as 4000 requests/second. Not so good for your dreams of a C10K web application...Workaround:
The code above works because the net_uv.js module passes the entire Net (or HTTP) object to it's internal wrapper for the listen method of
process.binding('tcp_wrap').TCP
. Either adding (and documenting) a setter in the HTTP.Server module, or doing this, could alleviate a great deal of suffering for future developers.The text was updated successfully, but these errors were encountered: