HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Server Operation (
-   -   Nginx + php-fpm (

theCCstone 9th June 2013 23:46

Nginx + php-fpm
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

saosangmo 20th June 2013 00:58

hi theCCstone,
I'm newbie here and get the same problem. Did you find the solutions?

levina85 26th June 2013 16:17

I am also having the same problem in Nginx. Were you able to find the solution to the issue?

harkman 2nd July 2013 16:00

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

theCCstone 9th July 2013 03:56

Nginx + php-fpm
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 (:

pititis 9th July 2013 21:00

The solution is use ondemand mode in each pool configuration.


pm = dynamic (or pm = static)


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


;  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.


theCCstone 10th July 2013 04:02

Thank you. Worked perfectly now = D

All times are GMT +2. The time now is 19:36.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.