Tuning PHP-FPM Settings for Performance
Most PHP applications installed via your Opalstack dashboard include two options for performance tuning:
- FPM Max Child Threads: this is the maximum number of processes that will run to serve your site.
- FPM Max Requests: this is the number of requests that each process will serve before restarting.
Our general recommendations for these settings are:
- If your site is struggling due to heavy traffic, then use a higher value for FPM Max Child Threads. Note that this may result in higher memory usage due to a higher number of simultaneous requests to your site.
- If your site is using too much memory due to a memory leak then use a lower value for FPM Max Requests. Note that this may result in lower performance due to the overhead of starting new processes to service more requests.
In practice, effective performance tuning may require adjustments to both of these parameters. Opalstack makes no specific recommendations as to how these parameters should be set for a particular application or level of traffic. To figure out the best settings for your site, you will need to monitor your site's performance and adjust the settings accordingly.