By Lex Gabrees
Hi,
I was just reading this post : https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration , which states the number of worker processes for NGINX can be calculated by multiplying the number of CPU’s with the number that comes out of ulimit -n … this command gives me 1024.
Since I have 2 cores that would be :
worker_processes : 2 (or auto) worker_connections : 1024 (or would that be 2048?)
For the sake of it : why is it that I get 1024 on a 512MB droplet, while I also get 1024 on a 2G droplet ?
I’d like to know the following : should I try to set this limit higher for optimal performance ? If yes, how high should I set it, and how do I do this (in regard of ulimit) ? I am running an PHP app on this droplet that tracks clicks (and redirects to other pages) … It somehow doesn’t make sens to have the same worker_connections on a 2G droplet as on a 512MB droplet …
I might be wrong, so that’s why I’m asking …
Thanks in advance, Lex
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Both servers have the same number of cores, so leaving them both set to 1024 is advisable.
Hello there,
You can leave the value as it is for the moment if you’re not having any performance or traffic spike-related issues.
We have an article on How to optimize Nginx Configuration which you can check here:
https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration
Regards
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.