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