PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites.
Proper process calculation ensures optimal use of server resources, improves performance, and prevents issues like memory exhaustion.
These settings can be applied in your php-fpm.conf file or the pool configuration file, typically located in /etc/php/8.x/fpm/pool.d/www.conf (path may vary based on your setup).
Consider using the dynamic pm mode, which allows PHP-FPM to adjust the number of child processes based on the current load.
While these calculations provide a excelent starting point, it's important to test and adjust based on your specific environment and application needs.
pm.max_children sets the maximum number of child processes that can be created to serve requests. It's crucial for controlling server resource usage.
These settings work together to manage the number of idle processes. pm.start_servers sets the number of child processes created on startup, while pm.min_spare_servers and pm.max_spare_servers define the minimum and maximum number of idle child processes.
The RAM buffer is a safety margin to prevent your server from using all available RAM. It helps ensure system stability and provides room for other OS/processes.
It's recommended to review your PHP-FPM settings regularly, especially after significant changes in traffic patterns or server resources. Monthly or quarterly reviews are common practices.
While this calculator is specifically designed for PHP-FPM, the general principles of resource allocation can be applied to other server configurations. However, the specific settings and terminologies may differ.
PHP-FPM offers better performance and more granular control over process management compared to traditional PHP CGI. It allows for better resource utilization and can handle high-traffic situations more efficiently.