Your business is always on the go and who knows when your web site will need to sustain a high volume of connections. How is it possible to sustain >100K of http(s) concurrent connections? By increasing the web server limits.

 

By default Microsoft IIS 7.5 and higher is properly configured to sustain a high volume of connections. You will only need to apply this guide if you are using nginx because you are using a modern web server, right?

Default nginx settings

We deployed a standard wordpress website on a LEMP stack in a small VM with 1 vCpu and 512 MB RAM. We did a 7k connections Free DDoS with 1 minute rampup on the website without the limits increased and with the limits increased.

We see that by default nginx can only accept a very low amount of concurrent connections.

Graph showing the rampup of zombie bots attacking the website not reaching full power

Without the limits increased

We can observe that the response time of the HTTP requests are going as high as 3 seconds and 50 requests failed.

Monitoring graph showing results of bad response time with many failed requests

With the limits increased

We are now using the exact same server with the limits increased. We can observe that the average response time is around 45 milliseconds!

Monitoring graph showing good and stable response time

Optimized nginx

Now the web server can sustain a high volume of connections.

Graph showing results of connected zombies

How to increase nginx server limits?

You will need to set the worker_processes to auto and to increase worker_rlimit_nofile and worker_connections settings in the nginx.conf file. Locate the part that start with events { and adapt your config so that it looks similar to this:

# Let nginx find the number of processes based on the nb of cpu
worker_processes  auto;

# Change the limit of open files
worker_rlimit_nofile 102400;
events {
  # The worker connections should be the worker_rlimit_nofile
  # divided by the number of worker_processes
  worker_connections 102400;
}

This tells nginx to allow >100K connections. Which is fairly enough for now.

Did you test your web server limits recently?

Increasing your web server limits will greatly help you hold the siege of any sudden DDoS. Also, it will crank your website to sustain a big amount of clicks! We can help your Business to hold a high volume of connections.

 

Test server limits

Increase web server limits to sustain high volume of connections