Question

Temporary Usage Spikes: When's the threshold for scaling up the droplet?

Contemplating a strategy for dealing painlessly (ie. automatically) with temporary traffic spikes on a droplet running a LAMP stack. (On a basic droplet, and prefer to keep the size until ongoing loads increase.) I realize you could replicate the droplet and load-balance horizontally, however that may be a bit more than I care to deal with at the moment.

I notice the API allows calls for resizing the droplet – and that there’s a reversible mode of resizing (that only adds CPU & RAM). I’m thinking about setting up a system to monitor the server load that issues a resize request when a certain threshold is crossed, and then revert when the load returns to normal. Does that seem like a sensible approach? And would it be considered good practice by DigitalOcean’s side If I were to resize frequently?

While we’re on the topic, I’d love to hear more thoughts on what you consider a threshold high enough to merit resizing (level/duration). I’m thinking of probing both the overall CPU/RAM load and getting specific performance data from Apache/MySQL for threshold factors. Please share any experiences or pointers for further digging. Thanks!


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.

I don’t think DigitalOcean cares how frequently you resize, but I would not recommend it as it have one drawback.

Resize is OK, but keep in mind that every resize is a downtime. To resize droplet you need to completely power it off, do resize, power it on. Resize sometimes takes longer time to execute. This is note from DigitalOcean Control Panel for CPU&RAM resize:

Note:  This Resize event may take longer than normal

So when you get high spike, you have a lot of consumers using your site, and you just take it off for half hour in middle of that spike. I would say don’t do it!

Load balancing is your best bet. DigitalOcean have many tutorials on this topic. Take a look on it, also I can recommend What is high availability as it have explained how you can make your seutp.

This will take some time to research and setup, but it will fix your problem for long time, you will get better performance and maybe better uptime. Resizing will only get you downtime, for time it need to execute, and sometimes it can take long

And while I’m reflecting here, the resize routine should also feature adjusting Apache/MySQL configuration to match different up-scaled CPU/RAM configurations. This question is really more about response strategy than identifying the threshold, but alas I can’t seem to edit the original post.