Using the following setup my server is able to handle lots of (virtual) concurrent users.
worker_processes 4;
worker_connections 8192;
worker_rlimit_nofile 40000;
Here’s how I calculated these values on a 8 GB RAM / 4 CPUs droplet:
worker_processes
= 1x for each CPU
worker_connections
= 2048 x 4 CPUs
worker_rlimit_nofile
= roughly 10.000 per core (my wild guess)
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!
Those settings look sane to me and seem to follow best practices. This blog post has been helpful to me in understanding these setting:
For more information on optimizing Nginx, check out: