I ask that the web server works with a light front (nginx in my case), while PHP processes are processed through fastcgi.
I am trying to figure out a methodical method for calculating how many PHP cgi processes should run on a machine.
One way to think about this is to find out the average amount of memory in the process and run as much as possible within the available RAM. However, this does not lead to the use of CPU in this matter.
Since the CPU is the real bottleneck in my application (DB and memcache are used, but are not bottlenecks), I think that the base number for php processes should be the number of available processors.
For example, on an 8-core computer, the base number will be 8. Assuming some processes are waiting for a database or network, I see no reason to run more than 20 PHP processes alltogether.
Does this way of thinking make sense? How do you calculate how many processes you need to run?
source share