Optimizing worker_processes, worker_connections & PHP_FCGI_CHILDREN - Any Good Tutorial?
Rahul Bansal
rahul.bansal at rtcamp.com
Tue Jun 15 23:59:15 MSD 2010
Hi jerome.
With your additional inputs, Can I safely set following rules for personal
use?
Of course, any configuration needs monitoring/tweaking. But I think its
better to start with a base config which will be closer to the optimal
config.
*Now for...
worker_connections
*1024/2048 are safe values. So its better if I leave them untouched.
*worker_processes*
Number of CPU core or its multiplier (assuming u have dynamic application
with decent caching)
More process ==>> Less Dynamic and Lower PHP_FCGI_CHILDREN
Less Process ==>> More Dynamic and Higher PHP_FCGI_CHILDREN
*PHP_FCGI_CHILDREN
*Using TOP command and looking at RES memory value.
Finding memory required by single instance of PHP. (in my case its 40MB and
VIRT is 100MB!)
Then doing arithmetic like:
[Available RAM] = (Actual RAM) - (100 M or more OS + 200 M for DB + 16M for
nginx (I have 8 worker_process with 2MB memory for each ))
Then,
PHP_FCGI_CHILDREN = [Available RAM] / Single PHP instances' memory
requirement
Sorry for trying to get mechanical here.
But I already started to have better insight into all configuration
variables I was curious at.
Also are these numbers in anyway gets affected by fastcgi_cache -
http://wiki.nginx.org/NginxHttpFcgiModule#fastcgi_cache
Does fastcgi_cache reduces load on fascgi-php ?
--
Rahul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20100616/956ca5f7/attachment-0001.html>
More information about the nginx
mailing list