Web / NGINX Interview questions
Why is the worker_connections directive important for concurrency limits?
events { worker_connections 1024; }
worker_connections sets the maximum number of simultaneous connections a single worker process will accept, and it directly caps NGINX's total concurrency ceiling.
Total theoretical concurrent connections is roughly worker_processes × worker_connections, though in practice each connection - client-to-NGINX and NGINX-to-upstream if proxying - can consume more than one "slot" from that pool, so real capacity is somewhat lower than the raw multiplication suggests.
Set it too low and NGINX starts rejecting or queuing connections well before the server's actual hardware is under strain, silently limiting throughput. Set it too high without also raising OS-level file descriptor limits (ulimit -n), and workers can hit "too many open files" errors trying to exceed what the kernel allows.
More Related questions...