Knowledgebase

nginx workers and php-fpm workers - same count?

Posted by raindog308, 03-02-2012, 01:33 PM
I'm looking at my nginx and php-fpm configuration (Linux, Debian, OpenVZ VPS w/1GB memory). I assume I should set things so that the number of nginx and php-fpm workers is the same? For nginx: set worker_processes to some number For php-fpm: probably set the min_spare_servers to the same as nginx's worker_processes. I don't think there would ever be a case where there would be more php-fpms than nginx worker processes...right? Does that make sense or am I thinking about things wrong?

Posted by RoseHosting, 03-03-2012, 11:16 AM
General rule is to use one nginx worker per CPU core. quad-core CPU -> worker_processes 4; Since php-fpm version >= 5.3.9, you can set the pm to "ondemand" (pm=ondemand). No children are created at startup. Children will be forked when new requests will connect.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Managed.com Down (Views: 653)
Server Reboot... (Views: 584)


Language:

Client Login

Email

Password

Remember Me

Search