-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
This is how I started php-fpm in the supervisord.conf.
[program:php-fpm]
command=/usr/local/sbin/php-fpm --nodaemonize -c /usr/local/etc/php-fpm.conf
autostart=true
autorestart=true
numprocs=1
process_name=%(program_name)s_%(process_num)02d
stderr_logfile=/var/log/supervisor/%(program_name)s_stderr.log
stderr_logfile_maxbytes=10MB
stdout_logfile=/var/log/supervisor/%(program_name)s_stdout.log
stdout_logfile_maxbytes=10MB
In the php pool file,
pm = ondemand
pm.max_children = 30
pm.process_idle_timeout = 10s
On the container, I'm watching the processes thru 'top'. I saw one php-fpm master process, and 2 child processes spun up and then killed in 10s, and immediately another 2 child processes spun up and again killed in 10s because they were idle, and it's going on and on... In the meantime, I'm watching the web log, I'm not seeing any HTTP requests coming in as it's a dev server.
Question is why supervisord keeps spinning up 2 child processes each time?
I also tried with pm=dynamic, and I expected more child processes when I was doing a load test on the website, and I set max_children to a large number. But seems the max_children is ignored and there was only 3 child processes all the time.