By duncanwoods
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 …?
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!
You could always replicate it (create a snapshot and create new droplets off that snapshot) and set up Round Robin DNS, that would be the easiest way to do it. Scaling vertically (resizing your droplet) is also an option. <br> <br>Also check out <a href=“https://www.digitalocean.com/community/articles/how-to-use-haproxy-to-set-up-http-load-balancing-on-an-ubuntu-vps”>https://www.digitalocean.com/community/articles/how-to-use-haproxy-to-set-up-http-load-balancing-on-an-ubuntu-vps</a>.
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.
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?
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.