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.
How a machine counts as idle
Section titled “How a machine counts as idle”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.
The warning
Section titled “The warning”Before it stops, the machine gets a warning. While the warning is showing, a developer can keep it running:
deployport machinery machines autostop suppress <machine-id> 4hThe 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:
deployport machinery machines autostop clear <machine-id>The settings
Section titled “The settings”The settings live on the profile, under the power domain:
| path | what it sets |
|---|---|
power.idleAlarm.enabled | whether the machine works out that it is idle |
power.idleAlarm.idleForSeconds | how long it must be quiet before that counts |
power.idleAlarm.cpuMaxPercent | the CPU ceiling for idle |
power.idleAlarm.networkMaxBytesPerSecond | the network ceiling for idle |
power.autoStop.enabled | whether an idle machine stops itself |
power.autoStop.headsUpSeconds | how long the warning shows first |
power.autoStop.suppressionMaxSeconds | the longest suppression a developer may ask for |
Write one with machine-profiles set, naming the path:
deployport machinery machine-profiles set <profile> <domain>.<slot>.<setting>A machine that is stopped
Section titled “A machine that is stopped”A stopped machine keeps its disk, and connecting to it starts it again:
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.