I recently moved my mpm from perfork to event (& also mod_php (php7.0) to php-fpm (proxy_fgi)) I estimated my max concurrent connection load to be around 300. So i set the following configuration in mpm_event.conf
StartServers 5
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 35
MaxRequestWorkers 350
MaxConnectionsPerChild 0
Now I see some strange behavior when I observe the apache2 process and total threadcount using ps
Normally I have around 12-13 total apache2 processes (ps aux | grep apache2 | wc -l
). Considering one to be parent.. so it is about 10-11 children. Further if I see the total threads count from apache2 with
ps -o nlwp $(pidof apache2) | tail -n +2 | awk '{ num_threads += $1 } END { print num_threads }'
I observe 408 threads for a long time.. So my questions are:
- how is it possible that total # of threads increasing beyond MaxRequestWorkers (350)
- how is it possible that total # of child processes increase beyond StartServers (5)
- What is the justification for 408? (12*34?) and is my traffic hitting a limit?
Thanks for your help in advance