Optimizing worker_processes, worker_connections & PHP_FCGI_CHILDREN - Any Good Tutorial?

rahul286 nginx-forum at nginx.us
Tue Jun 15 19:39:37 MSD 2010


First - all my servers are running fine. Thanks a ton to nginx! Lately,
I have been brainstorming a lot on 3 configuration variables to squeeze
maximum performance that I can get from my hardware.

[b]3 variables of my interest are:[/b]
[list=1]
[*] worker_processes
[*] worker_connections
[*] PHP_FCGI_CHILDREN
[/list]

I searched extensively on Google, mailing lists, wiki, etc but till date
couldn't find any robust guide as on how these affects performance and
other aspects of my webserver/webapp.

As I am aiming for very-very high traffic configuration, I will first
move all images/js/css load to CDN.
So my nginx will be mostly busy in dealing PHP stuff.
[list]
[*] So will it make more sense to increase PHP_FCGI_CHILDREN or
worker_processes?
[*] Is it good to make [i]PHP_FCGI_CHILDREN = 1[/i] if I am using APC
for PHP opcode caching?
[/list]

If I want to achieve number of 100,000, then what is difference between
following arithmetic: 
[list]
[*] 10 worker_processes * 10,000 worker_connections * 1
PHP_FCGI_CHILDREN
[*] 10 worker_processes * 1,000 worker_connections * 10
PHP_FCGI_CHILDREN
[*] 10 worker_processes * 100 worker_connections * 100
PHP_FCGI_CHILDREN
[*] 1 worker_processes * 1000 worker_connections * 100
PHP_FCGI_CHILDREN
[*] 1 worker_processes * 100,000 worker_connections * 1
PHP_FCGI_CHILDREN
[/list]
I know this arithmetic is not straight-forward as 3 variable controls 3
different aspects. But how does they impact each other?  How amount of
RAM, traffic pattern, PHP/non-PHP traffic ratio affects them?
 
In short, what are all parameters I must consider?

Sorry if some of my questions sounds lame. But I really wants to dig
deeper into nginx config for high traffic load.
Also if you think I am totally going in wrong direction, please feel
free to correct me.

Thanks,
 -Rahul

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,98498,98498#msg-98498




More information about the nginx mailing list