I've a site running Magento on the following setup:
- Apache 2.4 with mpm_worker
- PHP-FPM
- Total RAM in server: 14GB (10GB avilable to Apache/PHP)
Each PHP-FPM process consumes approximately 80MB of RAM.
I want to fine tune the settings for PHP-FPM and mpm_worker. Reading in the documentation I'm a bit confused about the relation between options in PHP-FPM and mpm_worker.
E.g., PHP-FPM has configurations: pm.min_spare_servers
, pm.max_spare_servers
, pm.start_servers
and max_children
. I understand what these options mean with respect to PHP-FPM.
However, mpm_worker has the following configurations: MinSpareThreads
, MaxSpareThreads
, StartServers
and ThreadLimit
. Again, isolated to mpm_worker I understand what they do.
My question is: How does these configurations relate to each other? Let's say I set StartServers=2
and ThreadsPerChild=25
. This would give me 50 threads to begin with with respect to Apache/mpm_worker. If I then set pm.start_servers = 50
, PHP-FPM will spawn 50 processes initially.
So what is the relationship between these 50 "Apache" threads and 50 "PHP-FPM" processes? Does each Apache thread utilize one PHP-FPM process?
I hope someone can give some insight into this.
Thanks!