Lighttpd error: sockets disabled, connection limit reached

Posted on November 25, 2013 at 10:43 pm

To fix this error message:

[note] sockets disabled, connection limit reached

You need to increase the max-fds and max-connections limit.

Add these lines in the lighttpd.conf file:

server.max-fds = 8192
server.max-connections = 4096

Restart Lighttpd:

/etc/init.d/lighttpd restart

Now type:

cat /proc/`ps ax | grep lighttpd | grep -v grep | awk -F " " '{print $1}'`/limits |grep "Max open files"

You should get as output:

Max open files            8192                 8192                 files

I would recommend to also edit the file limits.conf:

vi /etc/security/limits.conf

And add these lines:

# wildcard does not work for root, but for all other users
*               soft     nofile           4096
*               hard     nofile           32768
# settings should also apply to root
root            soft     nofile           4096
root            hard     nofile           32768

Then reboot the system:

shutdown -r now

Useful links:

Docs Performance – Lighttpd – lighty labs

Other Posts

Updated Posts