Feature #2116
closedadd server.listen-backlog option instead of hard-coded value (128 * 8) for listen()
Description
Lighttpd currently sets it's queue length to a hard coded value of 1024 (128 * 8) when calling listen(). This is non-optimal in circumstances where both the operating system 'and' lighttpd.conf have been configured for maxconn values > 1024.
It can result in listen queue overflows in cases where burst of new connections > 1024 but < server.max-connections are observed, causing connection resets.
On FreeBSD, netstat -Lan can display per-listening-socket queue lengths, but I don't think there's an equivalent command on Linux.
Current Behaviour:
lighttpd.conf: server.max-connections: NOT SET (defaults to 1024)
Current listen queue sizes (qlen/incqlen/maxqlen) Proto Listen Local Address tcp4 0/0/1024 *.80
lighttpd.conf: server.max-connections: 2048
Current listen queue sizes (qlen/incqlen/maxqlen) Proto Listen Local Address tcp4 0/0/1024 *.80
lighttpd.conf: server.max-connections: 512
Current listen queue sizes (qlen/incqlen/maxqlen) Proto Listen Local Address tcp4 0/0/1024 *.80
Relevant code section in question:
http://redmine.lighttpd.net/projects/lighttpd/repository/entry/branches/lighttpd-1.4.x/src/network.c if (-1 == listen(srv_socket->fd, 128 * 8)) {
Expected Behaviour:
server.max-connections value should be used for listen()
Slightly off-topic, HAProxy exhibits the correct behaviour of reflecting it's per frontend maxconn values in the listen queue lengths. I mention this purely for a representative and example case of expected behaviour.
Current listen queue sizes (qlen/incqlen/maxqlen) Proto Listen Local Address tcp4 0/0/2048 *.443 tcp4 0/0/4096 *.80 tcp4 0/0/2000 *.1357
Updated by stbuehler over 15 years ago
- Priority changed from High to Low
- Target version changed from 1.4.26 to 1.4.x
Updated by stbuehler over 15 years ago
- Subject changed from listen() call should use server.max-connections instead of hard-coded value (128 * 8) to add server.listen-backlog option instead of hard-coded value (128 * 8) for listen()
Updated by gstrauss about 9 years ago
- Related to Bug #1825: Don't disable backend when overloaded added
Updated by gstrauss about 9 years ago
- Related to Bug #1825: Don't disable backend when overloaded added
Updated by gstrauss about 9 years ago
- Related to deleted (Bug #1825: Don't disable backend when overloaded)
Also available in: Atom