Hello, I have a problem in the processes of php-fpm. I migrated from apache to nginx, however with nginx and php-fpm happens the following problem: php-fpm, even after closing the client connection, the process is still active in the system. Causing me to get the process of restarting php-fpm hourly. If anyone can help me, I'm grateful
I'm not a expert, but as far as I understand the system of nginx and php-fpm both maintain a pool of worker threads. If you have multiple websites that use their own priviliges both services will start at minimum 1 process for each site, to serve incomming requests. Starting new processes is very expensive in regards to processing time, therefore at least one worker process for each site should stay in the memory of the server, waiting for new requests. If you kill those processes, you will only raise the response time of your websites. Regards, Jürgen
Their placement is correct. My problem is that in addition to the standard thread. When more than one person accesses the website, it does not return to the default one processor, it is with the other assets in the memory accesses, slowly consuming all system memory. Thus it becomes impossible to use. If anyone knows anything, please help
The solution is use ondemand mode in each pool configuration. Change: pm = dynamic (or pm = static) for pm = ondemand and restart fpm. ondemand mode needs (PHP Version >= 5.3.9) Also see the pm.max_children and pm.process_idle_timeout directives if you choose ondemand mode Code: ; ondemand - no children are created at startup. Children will be forked when ; new requests will connect. The following parameter are used: ; pm.max_children - the maximum number of children that ; can be alive at the same time. ; pm.process_idle_timeout - The number of seconds after which ; an idle process will be killed. Cheers!