Auto-scaling

Let VMStack give busy servers of a plan more vCPUs or memory automatically, a step at a time up to a ceiling, with a restart and a cooldown.

Auto-scaling grows a busy server of a plan: when its CPU, or the memory in use, stays at or over a percentage for a number of minutes, the server gets more vCPUs or memory, one step at a time, up to a ceiling you set. It never shrinks a server back. It is off by default and is set per panel plan.

Warning: Read this before turning it on. Each grow is an upgrade the customer did not ask for: what you bill for it is up to you, and it stays. Each grow restarts the server. On a node you oversell, a grow takes room that other servers counted on.

How it works#

  • Auto-scaling reads the panel's five-minute usage samples, the same samples as the usage charts and abuse detection.
  • CPU is the server's CPU time against its vCPUs. Memory in use comes from the guest's balloon driver, which most cloud images have. Without it, memory scaling has nothing to read.
  • When the streak at or over the percentage lasts the set minutes, the panel upgrades the server by one step, capped at the ceiling. A server already at its ceiling is left alone.
  • The grow is an ordinary server upgrade with no account behind it: the node's room and the reseller's pool are checked as for any upgrade. The server is shut down and started again with the new size (about a minute), because the node does not add vCPUs or memory to a running server. The owner gets the usual upgrade mail.
  • After a grow, or after a try that was refused, the server waits the cooldown before the next one.
  • Only the panel's own plans can auto-scale. A reseller's plans cannot.

Turning it on for a plan#

  1. Go to Customers › Hosting plans and open the plan.
  2. Click Abuse policy and auto-scaling.
  3. In the Auto-scaling section, tick Grow busy servers of this plan.
  4. To grow vCPUs, tick vCPUs, when the CPU stays busy and set:
    • CPU at or over (%): default 90.
    • For (minutes): 10 or more; default 60.
    • Add vCPUs: the step, 1 to 16; default 1.
    • Up to (vCPUs): the ceiling. Required, and must be more than the plan's vCPUs.
  5. To grow memory, tick Memory, when the guest keeps it full and set:
    • Memory in use at or over (%): default 90.
    • For (minutes): 10 or more; default 60.
    • Add (GB): the step, in steps of 0.5 GB; default 1 GB.
    • Up to (GB): the ceiling. Required, and must be more than the plan's memory.
  6. Set Wait between grows (hours): 1 to 720; default 24. It also applies after a grow that was refused.
  7. Click Save.

The same page holds the plan's own abuse policy. A plan can have auto-scaling while following the panel's abuse policy.

Checking what happened#

Every grow and every refused try is in the audit log (System › Audit log):

Audit action Meaning
vm.autoscaled The server was upgraded; the entry has the new sizes and the task.
vm.autoscale_refused The upgrade was refused; the entry has the sizes wanted and the reason, for example that the node has no room.

The upgrade itself is a normal task on the server's page. The server also gets the server.upgraded webhook event.

If a server does not grow when you expect it to:

  • check that it is on a panel plan with auto-scaling saved, and that a ceiling is set for what you expect to grow;
  • check the cooldown: a refused try also starts it;
  • for memory, check that the guest reports its memory (the server's usage charts show memory in use);
  • look for vm.autoscale_refused entries with the reason.

Not supported#

  • Scaling down.
  • Growing without a restart (vCPU or memory hot-plug).
  • Disk growth.
  • Auto-scaling on resellers' plans or per server.