connect() to unix:/var/run/php-fpm/php.sock failed

Jérôme Loyet jerome at loyet.net
Tue Oct 16 08:47:53 UTC 2012


2012/10/16 justin <nginx-forum at nginx.us>
>
> Just finished running a benchmark with http://blitz.io on a development
> application written in PHP (using php-fpm with a unix socket, not TCP)
> connecting to MySQL. Started with 50 concurrent connections and scaled up to
> 250. Got lots of timeouts and errors. In my nginx log, the following is
> logged a bunch of times:
>
> 2012/10/16 01:28:29 [error] 15019#0: *26418 connect() to
> unix:/var/run/php-fpm/php.sock failed (11: Resource temporarily unavailable)
> while connecting to upstream,
>
> What could cause this? I am using nginx 1.2.4 with the following performance
> tweaks:
>
>     worker_processes 2;
>     worker_connections 1024;
>     sendfile on;
>     tcp_nopush on;
>     tcp_nodelay on;
>     keepalive_timeout 30;
>     gzip on;
>     gzip_proxied any;
>     gzip_comp_level 4;
>     gzip_disable "msie6";
>     gzip_types text/plain text/html text/css application/x-javascript
> text/xml application/xml application/xml+rss text/javascript
> application/javascript application/json
>
> PHP-FPM is configured with 8 static workers and listen.backlog = -1. Any
> idea how I can reduce the failures connecting to upstream (PHP-FPM)?
>

try setting listen.backlog to 128 in FPM configuration. It may be a
bug with listen.backlog = -1 on some FPM version.

++ jerome



More information about the nginx mailing list