rightlock.blogg.se

Php fpm workers
Php fpm workers









So my personal conclusion would be that "ondemand" is really the best method to use in terms of low/controlled memory usage, the only downside is the +50/100 ms in response time but in my case it is not a big problem. If I use "ondemand" the site is a little slower (like +50/100ms response time), but it can handle all the high traffic without using too much RAM. PHP workers decide the number of uncached demands that your website can handle at any time. This technology creates HTML pages to serve your site visitors. They construct pages and handle requests that require backend processing on your website. If I use "dynamic" it uses less RAM but after N concurrent connections there are frequent 502 errors (but maybe I configured it not well). Conclusion What Are PHP Workers PHP workers are background processes on servers that run PHP code.

php fpm workers

So I have to use a cronjob to periodically (every 1 hour) reload PHP5-FPM with /etc/init.d/php5-fpm reload. If I use "static", the website is for sure faster and can handle immediately high number of concurrent connections, but the memory always increases its usage, and after N hours it seems to use almost the total RAM available. Ondemand = I specify the max number of child processes to create, and then child processes are created on demand, when needed, and closed when not needed anymore, maintaining a low memory usage but increasing the response time of few milliseconds.įrom my tests with a high traffic WordPress website, I noticed that:

php fpm workers

Static = can be used to immediately create N child processes so they do not need to be opened/re-opened, they are already opened and can be used when needed, else they are "sleeping".ĭynamic = can be used to open a limited number of child processes and re-spawn then when a limit is reached (min/max servers). I have a Nginx + PHP5-FPM server with few high traffic websites.įrom my understanding of PHP5-FPM pools config, I understood that:











Php fpm workers