Automatically spin up droplets depending on the current load

December 1, 2015 1.5k views

I want to setup a master droplet with some kind of orchestration/provisioning tool and then say "here is an initial Linux slave and an initial FreeBSD slave. When either type is overloaded, automatically spin up additional droplets of that type".

Basically, automatic horizontal scaling of two server pools. I don't want to manually have to create new droplet, it needs to be automatic depending on the load.

Can someone point me in the right direction? I've been reading around about various orchestration and provisioning tools but I just got lost in the plethora of different solutions and buzzwords which may or may not be what I am looking for.

  • You're asking for something ridiculously complex and the solution is really to try the plethora of different solutions and buzzwords you found. This level is automation is a huge undertaking for most people. Try tools, see how they work, and try to accomplish your goal.

  • i do not think it is ridiculous.

    1) shell checks for load usage,
    2) shell find high load then runs pool.sh
    3) pool.sh uses the digital ocean api, spins new vm up or if vm way too high spins 4 up
    4) pool.sh now made 4 vm's.
    5) pool.sh now is going to start changing the default password etc.
    6) pool.sh runs copyfiles.sh.
    7) copyfiles.sh is now running and rsyncing files from the master via the internal ip (locally) to the new vm's
    8) copyfiles.sh is now complete and passes it off to add.sh
    9) add.sh now found the new vm ( Static File from pool.sh) and is inserting the new vm ip's into the master server ie nginx load balancer, with weighted options etc,
    10) add.sh now reloads nginx.
    11) the newly created vm's are now being used.
    12) i am sure i left something out but thats one way.

  • I don't even need any file copying or anything else really, just provisioning of new VMs when load is close to 100%. Seems like a regular thing that should already exist, I just don't know where to start.

  • Cen,

    This type of structure also very much depends on what you're using those two pools of Droplets for - are these database servers, web servers, load balancers, app backend servers... etc. Essentially, what is creating the load on these servers, and how would a new Droplet mitigate this issue?

  • Basically ideal horizontal scaling, no load balancers or anything, just more workers needed.

1 Answer

Hi Cen,

Your best bet with something like this would probably be some custom code using the DO API. I would probably approach this with some python code and a lib like Skiff (https://github.com/Shrugs/skiff).

There is also some additional info out there located here:



In this tutorial, we will demonstrate how to use DigitalOcean API to horizontally scale your server setup. To do this, we will use **DOProxy**, a relatively simple Ruby script that, once configured, provides a command line interface to scale your HTTP application server tier up or down. The primary purpose of this tutorial is to teach the minimally required concepts necessary to programmatically scale your DigitalOcean server architecture through the API.
Have another answer? Share your knowledge.