The Role of NGINX Workflows when Using Passenger

I am currently working on a project where we are using NGINX along with Phusion Passenger. I've done some research on how best to optimize the various configurations, but I still don't understand how increasing the number of NGINX worker processes fits the scenario. It seems that the real factor in optimizing for higher load is the increase in the number of passenger processes.

Can anyone shed some light on what is the difference between 1 NGINX workflow with 50 phusion passnger processes versus 2 NGINX workflows with 50 phusion passnger processes?

+3


source to share


1 answer


I'll try to try. There is a difference between nginx workers and passengers. You definitely don't want to have more nginx workers than kernels because that will just spawn idle processes. So if you have a 4-core processor, give nginx 4 a working one. just like that.

Now, when it comes to passenger workers, things get a little more complicated. You need to think about whether your application is consuming a lot of CPU time (like computing) or doing a lot of I / O (like database operations, file files, you name it) and configure the passenger accordingly.

Computation: Limit worker processes and threads to either the number of cores or a multiple of them - perhaps 2 or 3 times the number of cores you have. I / O: give it as many processes as cores, but as many threads as possible.



There are very well written blog posts about nginx and / or passenger setup with formulas and configuration information:

http://www.alfajango.com/blog/performance-tuning-for-phusion-passenger-an-introduction/ http://blog.phusion.nl/2013/03/12/tuning-phusion-passengers-concurrency- settings /

+5


source







All Articles