HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   Nginx + php-fpm (http://www.howtoforge.com/forums/showthread.php?t=62157)

theCCstone 9th June 2013 22: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 19th June 2013 23:58

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

levina85 26th June 2013 15:17

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

harkman 2nd July 2013 15: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 02: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 20:00

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!

theCCstone 10th July 2013 03:02

Thank you. Worked perfectly now = D


All times are GMT +2. The time now is 10:13.

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