Skip to content

Let a machine stop itself

A machine nobody is using is a machine you are paying for. A machine stops itself when it has been idle, so the meter stops too, and it warns you before it does.

A machine counts as idle when it stays under both of these, for a while:

  • a CPU percentage
  • a network rate

A build, a served request, or an open ssh session keeps it busy. The thresholds are profile settings, so one profile covers every machine that uses it.

Before it stops, the machine gets a warning. While the warning is showing, a developer can keep it running:

Terminal window
deployport machinery machines autostop suppress <machine-id> 4h

The longest suppression anyone may ask for is a profile setting, so nobody keeps a machine running for a month by accident.

To give it back:

Terminal window
deployport machinery machines autostop clear <machine-id>

The settings live on the profile, under the power domain:

pathwhat it sets
power.idleAlarm.enabledwhether the machine works out that it is idle
power.idleAlarm.idleForSecondshow long it must be quiet before that counts
power.idleAlarm.cpuMaxPercentthe CPU ceiling for idle
power.idleAlarm.networkMaxBytesPerSecondthe network ceiling for idle
power.autoStop.enabledwhether an idle machine stops itself
power.autoStop.headsUpSecondshow long the warning shows first
power.autoStop.suppressionMaxSecondsthe longest suppression a developer may ask for

Write one with machine-profiles set, naming the path:

Terminal window
deployport machinery machine-profiles set <profile> <domain>.<slot>.<setting>

A stopped machine keeps its disk, and connecting to it starts it again:

Terminal window
deployport machinery ssh <machine-id>

That is the whole point of the pairing: stopping costs nothing while it lasts, and reaching the machine again is one command.