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

justin nginx-forum at
Tue Oct 16 08:43:34 UTC 2012

Just finished running a benchmark with 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

    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)?

Posted at Nginx Forum:,231839,231839#msg-231839

More information about the nginx mailing list