nginx,

Improve Nginx performance with worker_processes

Jul 10, 2023 · 1 min read · Post a comment

worker_processes is a directive that determines the number of worker processes spawned by Nginx to handle incoming requests. Simply put, a single-threaded process with default value of 1 which means that it uses only a single CPU core. As for performance improvement here’s a neat thing you could try.

Prerequisites

  • Nginx

Solution

Open the main nginx.conf file, find the directive worker_processes and set it’s value to auto. For instance:

## nginx.conf
...

worker_processes auto;

Step 2. Restart Nginx: sudo systemctl restart nginx.

Conclusion

In case you face any issues, feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.