![]() Also, not so high as to overwhelm CPU(s) and have a pile of pending PHP-FPM operations. In other words, when you do the math, pm.static should be set to the max amount of PHP-FPM processes that can run without creating memory availability or cache pressure issues. On the other hand, if you have the memory available, you can avoid much of the PHP process manager (PM) overhead by setting pm static to the max capacity of your server. If you suffer from low server memory, then pm ondemand or dynamic maybe be better options. The PHP-FPM pm static setting depends heavily on how much free memory your server has. Using ‘pm static’ to achieve your server’s max performance For example, read about the ‘force_turbo’ setting on Raspberry Pi, which forces your RPi board to use the performance governor where performance improvement is more noticeable due to the low CPU clock speeds. Once set to performance, it is the fastest setting for your CPU. The only other factors would be heat, battery life (laptop), and other side effects of permanently clocking your CPU frequency to 100%. With CPU governor, the performance setting is a safe performance boost because it’s almost entirely dependent on your server CPU’s limit. Notice the similarities? I wanted to use this comparison first, intending to find the best way to write an article that recommends using pm static for PHP-FPM as your first choice. See the full list of CPUFreq governor options for further details. Governor = performance – Always run the CPU at the maximum frequency. Scales the frequency more gradually than ondemand. ![]() Governor = conservative = Scales the frequency dynamically according to the current load. It jumps to the highest frequency and then scales down as the idle time increases. ![]() Governor = ondemand – Scales CPU frequency dynamically according to the current load. This time, let’s compare the descriptions and look for similarities: These settings, available on both *nix and Windows, can improve the performance and system responsiveness by changing the CPU governor setting from ondemand to performance. Remember CPU frequency scaling? (CPUFreq governor) Ok, we’ve all had slow CPU issues, whether it be a laptop, VM or dedicated server. This may seem a bit off-topic, but I hope to tie it back into our PHP-FPM tuning topic. PHP-FPM process manager (PM) similarities to CPUFreq Governor See the complete list of global nf directives for further details. Pm = static – the number of child processes is fixed by pm.max_children. Pm = ondemand – the processes spawn on-demand (when requested, as opposed to dynamic, where pm.start_servers are started when the service is started. Pm = dynamic – the number of child processes is set dynamically based on the following directives: pm.max_children, pm.start_servers,pm.min_spare_servers, pm.max_spare_servers. However, let’s compare the two management options based on php.net’s documentation and also compare my favorite for high-traffic setups – static pm:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |