Handle 50000 concurrent connection

April 16, 2014 6.2k views
I have a static site. The site would have just some javascript and static content. I need to handle about 50,000 concurrent visitors. Can anybody explain which kind of architecture and technology is needed (e.g. single server / ngnix load balancing / ..)
1 comment
  • When I run “ netstat -an | grep :80 | wc -l ” I get 5k - 22k on a single $5 droplet and i have 5 droplets shielded under cloudflare to load balance all my spark traffics.

    my current server setup

    Yes, It is true I needs to setup a better $5 droplet that able to handle 50K connection in a real time and it is unhealthy for a web server to reach its maximum and unstable.

3 Answers
Are you sure you will be getting 50000 concurrent connections? That equals approx. 129,600,000,000 connections per month.

Nginx works pretty well for static websites, you can start off with a 2GB droplet (in order to get 2 CPU cores) and scale up if needed. Make sure you set nginx to use 2 worker processes (/etc/nginx/nginx.conf).

If you won't be getting that amount of traffic, a 512MB droplet will do just fine.
50000 is the highest amount of connection at one specific time, Average concurrent connection will be lower.


It's hard to make generalizations. The best thing to do would be to spin up some droplets and do some load testing of your set up. Consider throwing something like Varnish up in front of nginx to do some caching.
Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!