I have some error with subj. The server is not loaded with high load: ~ 15% of the CPU, there are several GB of memory, the hard disk does not work. But error 502 is thrown in about 3% of cases.
Programs: Debian 6, nginx / 0.7.62, php5-fpm (5.3.3-1).
The .log nginx error has this error:
connect() to unix:/var/run/php5-fpm.sock failed
The state of php5-fpm usually looks like this:
accepted conn: 41680 pool: www process manager: dynamic idle processes: 258 active processes: 1 total processes: 259
I think this average load is small.
I increased the backlog parameters: in sysctl - net.core.somaxconn = 5000, in the php-fpm pool - listen.backlog = 5000. No effect.
I quote the configuration:
/etc/nginx/nginx.conf
user www-data; worker_processes 8; timer_resolution 100ms; worker_rlimit_nofile 20240; worker_priority -5; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 2048; use epoll;
/etc. / Nginx / php _location
fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; fastcgi_buffers 256 128k;
php-fpm pool
[www] listen = /var/run/php5-fpm.sock listen.backlog = 5000 listen.owner = www-data listen.group = www-data listen.mode = 0666 user = www-data group = www-data pm = dynamic pm.max_children = 1024 pm.start_servers = 64 pm.min_spare_servers = 64 pm.max_spare_servers = 128 pm.max_requests = 32000 pm.status_path = /system/php5-fpm-status slowlog = /var/www/log/php-fpm.log.slow chdir = /var/www
What can I do to optimize this system and use all server resources?
PS. Sorry, my English is bad.
php nginx fastcgi
andre487 May 6 '12 at 11:18 2012-05-06 11:18
source share