Project

General

Profile

lighty 1.4.26: (server.c.882) can't have more connections than fds/2: 49000 34464

Added by quanta over 14 years ago

Hi all,

A few days ago, I got the error "(http-header-glue.c.339) strptime() failed on Sun, 26 Nov 3119 28:16:22 GMT" with lighty 1.4.22. And I decided to upgrade lighty to 1.4.26 version. But when I restarted lighttpd, the warning in the subject appeared. Open the error log, I got :

(mod_fastcgi.c.1734) connect failed: No such file or directory on unix:/var/tmp/lighttpd/php-fastcgi.socket-0
(mod_fastcgi.c.3037) backend died; we'll disable it for 1 seconds and send the request to another backend instead: reconnects: 0 load: 3
child died somehow, waitpid failed: 10

but in the config, server.max-fds and server.max-connections is 100000 and 49000 respectively.

What does 34464 mean?


Replies (4)

RE: lighty 1.4.26: (server.c.882) can't have more connections than fds/2: 49000 34464 - Added by nitrox over 14 years ago

This is a problem with your backend and lighty can´t do much about it:

(mod_fastcgi.c.1734) connect failed: No such file or directory on unix:/var/tmp/lighttpd/php-fastcgi.socket-0
(mod_fastcgi.c.3037) backend died; we'll disable it for 1 seconds and send the request to another backend instead:
reconnects: 0 load: 3 child died somehow, waitpid failed: 10

You need to fix your php settings.

server.max-fds and server.max-connections are iirc unsigned short integer (look at the source), so <= 65536. They have nothing to do with your above problem. Set them to sane value like server.max-fds 4096 and server.max-connections 2048. Just within the fds/2 rule. If you aren´t facebook you´ll probably never see a warning about that again.

Beside that you can enable mod_status and watch the number of connections (refer to this wiki please) and set keepalive within sane limits (between 5-30 seconds).

RE: lighty 1.4.26: (server.c.882) can't have more connections than fds/2: 49000 34464 - Added by icy over 14 years ago

Yes those options are unsigned short so 2^16 or 65536. Your number 100000 is too high and overflows this variable so 100000 - 2^16 = 34464, that's why you end up with a lower max-fd number than max-connections (49000 fits into 2^16)

RE: lighty 1.4.26: (server.c.882) can't have more connections than fds/2: 49000 34464 - Added by quanta over 14 years ago

OK, set max-fds and max-connections to smaller value, the warning in the subject disappeared. But I still get the following in the log file when restarted lighttpd:

2010-06-20 01:30:17: (mod_fastcgi.c.1734) connect failed: No such file or directory on unix:/var/tmp/lighttpd/php-fastcgi.sock
et-2
2010-06-20 01:30:17: (mod_fastcgi.c.3037) backend died; we'll disable it for 1 seconds and send the request to another backend
instead: reconnects: 0 load: 3
2010-06-20 01:30:17: (mod_fastcgi.c.2803) child died somehow, waitpid failed: 10

Permission of /var/tmp/lighttpd:

srwxr-xr-x 1 lighttpd lighttpd 0 Jun 20 13:18 php-fastcgi.socket-0
srwxr-xr-x 1 lighttpd lighttpd 0 Jun 20 13:18 php-fastcgi.socket-1
srwxr-xr-x 1 lighttpd lighttpd 0 Jun 20 13:18 php-fastcgi.socket-2
srwxr-xr-x 1 lighttpd lighttpd 0 Jun 20 13:18 php-fastcgi.socket-3

My fastcgi settings:

fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/tmp/lighttpd/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi",
"max-procs" => 4,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "128",
"PHP_FCGI_MAX_REQUESTS" => "100000"
),
"bin-copy-environment" => (
"PATH", "SHELL", "USER"
),
"broken-scriptfilename" => "enable"
)
)
)

The server-status page display 1071 connections.

How can I get rid of this warning? Thanks in advance.

PS: sometime, lighttpd shutdown not clean and it start with msg "can't bind to port : 80. Address already in use". Obviously I have no instance of any application run on port 80 (checked with lsof).

RE: lighty 1.4.26: (server.c.882) can't have more connections than fds/2: 49000 34464 - Added by nitrox over 14 years ago

Lighty has permission to not only access the socket files but also the path to /var/tmp/lighttpd has atleast r-x?

128 children sounds quite alot too, if you really need them, your php code seems broken (max-procs 1 and children 16 sounds good). For max_requests i´d also stay within sane limits (< 2^16). If you stop lighty, make sure your php die´s too and doesn´t leave old files behind. Check this when you close lighty. 1071 connections first sounds like alot, but if your php died they can quickly sum up, would be interesting in what state they are ("h"?).

We also have a chat #lighttpd on irc.freenode.net.

    (1-4/4)