What is PHP-FPM?
PHP-FPM is a PHP FastCGI implementation that is highly customizable compared to other PHP implementations (mod_php and su_php specifically) allowing you to fine-tune its performance targets. It is covered under all the PHP versions available on ClusterCS.
We initially pushed the option to use php-fpm based on a standard config regardless of your website requirements. This had its downsides in certain scenarios so we worked on a better implementation all around.
Also since our new default setting is ‘On Demand‘ it will help with your overall resource uses for the webmail or phpmyadmin components.
PHP-FPM settings can now be edited per each and every domain you manage on ClusterCS that is using php-fpm instead of su-php or mod-php. This allows for a better and quicker speed optimization you can bring to your domain.
You can now customize the following settings at a domain level:
- Number of Processes – the maximum number of children processes that can be alive at the same time
- Start servers – the number of children processes created on startup
- Min. spare servers – the minimum number of children processes in ‘idle’
state (waiting to process). If the number of ‘idle’ processes is less than this number then some children will be created.
- Max. spare servers – the maximum number of children in ‘idle’
state (waiting to process). If the number of ‘idle’ processes is greater than this number then some children will be killed.
There are 3 types of Process Management for PHP-FPM and those are:
On Demand (default)
Works on the same principal as su_php, which means that threads are created based upon incoming requests, here you can customize the maximum number of spawned processes in order to optimize your domain.
Works by spawning the maximum number of child processes at the start which are ready to receive requests but it is not recommended on servers with low RAM memory.
Recommended only for technical users, this allows for better customization and optimization as you can set up the values for the number of processes, started servers, min. spare servers, max. spare servers.
These settings will be available at Creating and Editing a domain as well as Editing Development Environments.
For the moment, when you create a Development Environment, it will be automatically set to “On Demand” with 15 max. threads since this is the least memory consuming option of the three. It can later be changed from the Edit Env page.
For existing domains that are using PHP-FPM, the default will be set to “On Demand” with 15 max. threads from the current Dynamic setting.
You can expect this update to hit the live version during next week.