Cobra Forum

Plesk Panel => Webserver => Topic started by: Suhitha on Mar 11, 2026, 05:54 AM

Title: How to calculate pm.max_children value on a Plesk server?
Post by: Suhitha on Mar 11, 2026, 05:54 AM
Applicable to:



Question

How to calculate pm.max_children value on a Plesk server?


Answer

1.Connect to the server via SSH.

2.Calculate and change the value of the parameter pm.max_children based on the amount of RAM on the system and the number of CPU cores (Each PHP-FPM process uses a CPU to execute PHP code. These processes are executed independently by the OS and compete for access to processor cores.).
The PHP script can:
- CPU-bound: Perform arithmetic, cycles, data conversions → loads CPU (CPU Load High)
- I/O-bound: Perform I/O waits (working with database, network, files) → CPU "waits", load drops (CPU Load Low/intermittent)
If you have a lot of CPU-bound logic, then: Number of cores = parallelism ceiling.
If you have a lot of I/O-bound logic, then: You can run more processes than cores (sometimes ×2–×4 of the number of cores), and everything will be ok.
This impacts CPU (and memory) load, especially during DDoS or peak access.

3.The following command will help to determine the memory used by each (PHP-FPM) child process:

# ps -ylC php-fpm --sort:rss
S UID PID PPID C PRI NI RSS SZ WCHAN TTY TIME CMD
S 0 931 1 0 80 0 87040 99039 ep_pol ? 00:00:00 php-fpm

Note: The RSS column shows non-swapped physical memory usage by PHP-FPM processes in kiloBytes.

4.The following command will help to determine the number of CPU cores:
# cat /proc/cpuinfo | grep processor | wc -l
8

5.If on average each PHP-FPM process takes ~85MB of RAM on the server, the appropriate value for pm.max_children can be calculated as follows:

pm.max_children = Total RAM dedicated to the web server / Max child process size
For example, if the server has 8GB of RAM and 6GB of RAM is planned to be allocated to the web server, then the pm.max_children value will be the following:

pm.max_children = 6144MB / 85MB = 72
In this case, the number of parallel processes per 1 processor core will be about ~10 (uses by Default).

Note: The received number of children has to be distributed among all websites on the server. Keep in mind that most popular websites require more children while others, non-popular ones - less. Be sure to consider the number of cores on your server to avoid overloading the processor with too many simultaneous processes.


                      Example of how to divide the result between websites

There are 3 domains on the server:

example.com


example.net


example.org

A little jewelry online shop that was created a month ago. The number of visitors is not high.

Is the appropriate pm.max_children value was calculated to be 72, in this case, it is required to allocate children, for example, as follows:


50 children.


2 children.


20 children.

To apply changes for pm.max_children value customize PHP settings as per the article.