Captain: What happen?
Mechanic: Somebody set up us the bomb!
So yeah, my blog was off the air for a couple of days. So what happened?
This is what
/var/log/nginx/error.log told me:
2016/06/27 08:48:46 [error] 22758#0: *21197 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 18.104.22.168, server: blog.amedee.be, request: "GET /wuala-0 HTTP/1.0", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "amedee.be"
So I asked Doctor Google “connect() to unix:/var/run/php5-fpm.sock failed (11: resource temporarily unavailable)” and got this answer from StackOverflow:
The issue is socket itself, its problems on high-load cases is well-known. Please consider using TCP/IP connection instead of unix socket, for that you need to make these changes:
- in php-fpm pool configuration replace
listen = /var/run/php5-fpm.sockwith
listen = 127.0.0.1:7777
- in /etc/nginx/php_location replace
followed by a carefull application of
sudo /etc/init.d/php-fpm restart sudo /etc/init.d/nginx restart
Tl;dr version: don’t use a Unix socket, use an IP socket. For great justice!
I leave you with this classic: