Nginx – Centos 6 – Nginx – [emerg] socket() 0.0.0.0:80 failed (105: No buffer space available)

nginx

I tried to restart nginx by doing:

/etc/init.d/nginx restart

However I receive this error message:

nginx: [emerg] socket() 0.0.0.0:80 failed (105: No buffer space available)
nginx: configuration file /etc/nginx/nginx.conf test failed

My server has been working fine until I did that and now my website won't load

Now every few pages I receive:

Error!
The page you are looking for is temporarily unavailable. Please try again later.

Would you guys be able to suggest a fix?

Edit – This is on a Centos 6 VPS

Best Answer

This problem can be from kernel+nginx interaction or some resource limitation on your VPS.

Try to add this to your config:

1. To decrease the number of opened sockets, turning off keepalive:

keepalive_timeout 0;

2. Decrease the size of tcp buffers (listen-sockets):

listen 80 default rcvbuf=8k sndbuf=32k;

Please also provide information from:

cat /proc/user_beancounters