Question

How to scale up for a temporary traffic spike?

Let say you have a low traffic $5 droplet running Ubuntu MEAN stack which is serving up static content with minimal database use which suddenly gets featured on the front page of a popular site e.g. NYT, Techcrunch, Hackernews etc.

How can you best handle this traffic spike and then return to your cheap lower traffic state?

Should you resize your droplet, spin up/down a cluster of droplets or …?


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

The best way to handle traffic spikes (for static content)? Using a Content Delivery Network (CDN). Leveraging traffic among several Droplets can be tricky (especially within a short time).

A CDN like KeyCDN is affordable and makes it easy to scale.

Vertical scaling is fine however you might reach a point where horizontal scaling is more performant and more cost-effective that horizontal scaling. <br>As long as disk space is not an issue it’s better to go with MongoDB replication instead of sharding for stability and redundancy. <br> <br>If you decide to use a load balancer you wouldn’t need round robin DNS records as there’s only one server that is actually going to serve the requests.

Thanks Kamal. <br> <br>If horizontal scaling it sounds like I have to: <br> - setup 1 load balancer droplet with HAProxy <br> - setup a mongo master <br> - setup 2+ node droplets with mongo shards <br> - setup DNS round robin <br> <br>https://www.digitalocean.com/community/questions/round-robin-dns <br>https://www.digitalocean.com/community/articles/how-to-set-up-a-scalable-mongodb-database <br>https://www.digitalocean.com/community/articles/how-to-create-a-sharded-cluster-in-mongodb-using-an-ubuntu-12-04-vps <br> <br>Whereas with vertical scaling, I can resize droplet with only a 1 minutes of downtime and only be charged the extra for the number of hours I keep the larger size. <br> <br>The vertical solution sounds like a low effort strategy to have in the bag. Are there any disadvantages?