5

I have a question about nginx. I have some webservers on my environment using nginx and they are behind Load balancer. Suddenly, all web services are down and I found this error log on nginx:

[error] 7097#7097: *44471950 connect() to unix:/var/run/php/php7.2-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: xxx.xxx.xxx.xxx, server: *.web.com, request: "HEAD /3.1?language=id&app=ios HTTP/1.0", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "web01.com"

Can anybody help me?

Paulo Boaventura
  • 1,365
  • 1
  • 9
  • 29
stupidoes
  • 51
  • 1
  • 2

1 Answers1

5

Please check Below Value, Default must be 128.

sysctl net.core.somaxconn

Increase this value by running the following command.

echo "net.core.somaxconn=65536" >> /etc/sysctl.conf
sysctl -p

Then restart PHP-FPM to take effect of new changes (Depends on Version of PHP-FPM).

service php-fpm restart 
service php7.2-fpm restart
Steve Robbins
  • 13,672
  • 12
  • 76
  • 124
SAB
  • 307
  • 4
  • 9
  • 5
    I know it's old but, it would be nice if you could write the reason to increase the value. – IamGhale Nov 20 '20 at 12:58
  • @IamGhale, he is trying to increase the maximum number of socket connections. [Here](https://serverfault.com/a/1029488) is explained fully. Cheers! – jmcollantes May 03 '23 at 11:37