PHP-FPM tuning: Using 'pm static' for max performance

Originally published at: PHP-FPM tuning: Using 'pm static' for max performance

Let’s take a very quick look at how best to set up PHP-FPM for high throughput, low latency, and more stable CPU and memory use. By default, most setups have PHP-FPM’s PM (process manager) string set to dynamic and there’s also the common advice to use ondemand if you suffer from available memory issues. However, let’s…

Hi @hydn

Thanks for the article, really helpful.

Have you considered the impact of these settings in a modern containerised environment?

I’m running a single PHP container for a low traffic website. Over time this traffic will grow, and at some point, will be fairly substantial.

I’m using the default settings - dynamic, 5 children, etc. - on a container with 0.5 vCPU and 1GB RAM.

I would like to be able to horizontally scale these containers so that when traffic increases I can bring new containers online. Ideally, I would do this automatically, based on the amount of CPU or memory the current container(s) are using (e.g. once they hit a threshold of 80%, a new container comes online).

What settings would you recommend for this environment?

1 Like

@dunc

When scaling using the hardware (0.5 vCPU and 1GB RAM) then no this article wouldn’t really apply. You can provide feedback and recommendations you find to work well for other readers.

Thanks for the feedback.