php-fpm idle processes do not die

583 views
Skip to first unread message

ms12345

unread,
Jul 25, 2016, 3:22:12 PM7/25/16
to highload-php-en
I have tried various config settings but I cannot get the idle processes to be killed.

for example:

process manager:      ondemand
start time:           25/Jul/2016:19:14:29 +0100
start since:          28
accepted conn:        36
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       1
active processes:     3
total processes:      4
max active processes: 3
max children reached: 0
slow requests:        0

a little while later I will have something like:


process manager:      ondemand
start time:           25/Jul/2016:19:14:29 +0100
start since:          1423
accepted conn:        3423
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       12
active processes:     3
total processes:      15
max active processes: 15
max children reached: 0
slow requests:        0

No matter how long I wait the idle processes do not die. Max processes from load/traffic spikes always stay even if 99% of them are idle until php is restarted. Also sometimes It hits max children then php-fpm stops responding from nginx and kills websites. Until PHP-FPM rebooted

I have tried playing with my nginx keepalive settings and changing pm.process_idle_timeout but neither works?
(also I tried both dynamic and ondemand php-fpm mode - still same issues..)


pm = ondemand
pm.max_children = 75
pm.process_idle_timeout = 30s
pm.start_servers = 5
pm.min_spare_servers = 3
pm.max_spare_servers = 10
pm.max_requests = 5000



NGINX

      open_file_cache max=1000 inactive=20s;
        fastcgi_cache_key "$scheme$request_method$host$request_uri";
        keepalive_requests 100;
        keepalive_timeout 30;
        open_file_cache_valid 30s;
        open_file_cache_min_uses 2;
        open_file_cache_errors on;
        proxy_connect_timeout       600;
        proxy_send_timeout          600;
        proxy_read_timeout          600;
        send_timeout                600;
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;



Reply all
Reply to author
Forward
0 new messages