I'm trying to understand the performance impact of having multiple nginx instances (masters) running on the same machine, rather than having them all load into a single instance using different server blocks. How does the use of multiple instances of nginx impact things like worker_process and worker_connections optimization?
I see tons of advice indicating that worker_process should mirror the number of cores, and at most should be double the number of cores. I'm also to understand that the worker_connections should match the ulimit, or be a bit under the ulimit. Making too many connections available, or having too many workers per core is supposed to hurt performance.
I have two cores and a ulimit of 1024, but I have 4 instances of nginx each of which has the following settings:
worker_processes 4; worker_connections: 1024;
Doesn't this have the same effect as if I had
worker_processes 16; and
Note: Let me make clear when I say nginx instances, I mean that there are 4 independent master nginx process each fed a different config file which has similar settings, and each with their own workers.
Note 2: This scenario is something I've inherited and is already in place. I am trying to figure out if I should change the way nginx is configured and have an informed reason for it.