Allocating worker processes

We now consider recommendations on allocating worker processes. First, let's discuss a little bit about the background. Nginx is an asynchronous web server, which means actual input/output operations run asynchronously with the execution of a worker process. Each worker process runs an event loop that fetches all file descriptors that need processing using a special system call, and then services each of these file descriptors using nonblocking I/O operations. Hence, each worker process serves multiple connections.

In this situation, the time between an event occurs on a file descriptor, and this file descriptor can be serviced (that is latency) depends on how soon a full event processing cycle can be completed. Therefore, ...

Get Nginx Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.