when optimizing PHP-FPM, there are usually two ways of thinking:
- setting pm.max_children, according to the number of CPU cores, such as * 2 + 2 cores, will pull the CPU very high, more than 70%, under the same pressure, but there is almost no fluctuation in memory.
- set pm.max_children, such as 30M/ * 100 = 3GB memory usage according to the number of memory. In this case, the memory will be pulled very high and fluctuate regularly with the recovery cycle, but the CPU does not fluctuate much, basically 10-40%.
from the test results of ab-c500-n 100000, the configuration is a little bit faster according to the number of CPU cores, which is not particularly obvious. If you use the amount of memory to configure, I feel that CPU computing resources are wasted again, and I am unwilling to do so.
do you have any suggestions?