G'day,
I'm running a FreeBSD box (9.1-RELEASE) with Nginx (1.2.7_1,1) and PHP-FPM (5.4.12). I'm having big problems with handling concurrent requests using Apache AB:
ab -n 10000 -c 500 http://10.128.28.164/index.php
The predominant error that I get in /var/log/httpd-error.log (in their thousands) is:
2013/03/08 11:11:10 [error] 99855#0: *44116 kevent() reported that connect() failed (54: Connection reset by peer) while connecting to upstream, client: 10.128.28.179, server: localhost, request: "GET /index.php HTTP/1.0", upstream: "fastcgi://10.128.28.164:9000", host: "10.128.28.164"
If I browse to the server (10.128.28.164) it works fine for HTML and PHP pages.
Any help would be amazing!!
Pete.
My php-fpm.conf file looks like this:
pid = run/php-fpm.pid
error_log = log/php-fpm.log
daemonize = yes
events.mechanism = kqueue
; Pool
[www]
user = www
group = www
listen = 10.128.28.164:9000
pm = dynamic
pm.max_children = 100
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_requests = 100
My nginx.conf file looks like this:
worker_processes 4;
error_log /var/log/httpd-error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
access_log /var/log/httpd-access.log;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
listen 10.128.28.164:80;
server_name localhost;
root /usr/local/www;
location ~ \.php$ {
fastcgi_pass 10.128.28.164:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
}
location / {
index index.html;
}
}
}