Idle suspend and wake locks
A machine that nobody uses is suspended on its own after its idle timeout: 10 minutes,
unless your operator set another for it. Suspending stops the machine; only its disk stays. Every
process ends: your shell, tmux, background jobs, an agent’s session. It resumes on a web
request to it, an SSH connection, a message sent with --qos notify or urgent, a
schedule with --qos notify, or space machines wake; its services start again.
Where your operator turned on hot suspend for your organization, a suspended machine’s memory
is kept as well while that is possible: it then resumes in about a second, with its processes
where they stopped. It is the same suspend in every other way, and nothing to rely on: a
machine whose memory could not be kept boots from its disk as described here. The machine’s
page in the portal and space machines show say “resumes in about a second” when it will.
Where your operator turned on cold suspend, a machine that has been suspended for more
than a day moves its disk to object storage, which costs less to keep. Its files are all
there: when it resumes, the disk comes back first, which takes a few seconds more, and then
it boots as usual. Machines made from a checkpoint, and machines with checkpoints, stay
where they are. The machine’s Manage dialog and space machines show say “resumes in a few seconds”
while it is suspended cold.
Where disks are on the hosts (where its disk is kept), a suspended machine’s disk is saved in object storage already; cold suspend drops the host’s copy, after a day or sooner when the host needs the room, and the machine resumes on any host. There, machines with checkpoints and machines made from one go cold too, once their checkpoints are saved.
What keeps a machine running
The machine counts as in use while any of these holds; the idle time starts when all are quiet.
| Kind | In use while |
|---|---|
ssh | an SSH session through the jump host is open and moved data in the last 10 minutes, or ended less than 5 minutes ago |
tunnel | a web request or WebSocket to it is open and moved data in the last 10 minutes, or ended less than 5 minutes ago; a WebSocket or event stream that nobody uses for 30 minutes is closed (open pages) |
exec, console | a command or console session from space or the portal runs |
guest | a space-env call to the platform runs, or ran less than 5 minutes ago (polls for waiting messages don’t count, nor does space-env receive while it waits: only a message it gets) |
cpu | it uses more than 5% of one vCPU, averaged over a minute |
net | a connection moved more than 2 KiB in the last minute (DNS doesn’t count) |
wakelock | something in the machine holds a wake lock |
A timer in a shell (sleep 1800) is none of these: it does not keep the machine running, and it
ends when the machine is suspended. Use a schedule with --qos notify to have
the machine resumed later.
A program that waits for messages (space-env receive in a loop) lets the machine be
suspended while it waits. A message sent with --qos notify or urgent resumes it, and the
waiting receive gets it (after a cold resume, the program’s next one). A whenever message
waits until the machine resumes for another reason
(QoS).
A chatty background program (telemetry, a sync daemon) can keep a machine from ever suspending. The machine’s status names the connection (address, port and how much it moved), so you can find it and stop it.
Status and the last call
space-env statusprints the idle timeout and either why the machine is in use or since when it is idle and when
it is suspended if nothing happens. The portal shows the same in the machine’s Manage dialog, and a suspended
machine as “suspended since … (idle)”, followed by “resumes in about a second” after a hot suspend
or “resumes in a few seconds” after a cold one.
A machine that has been running since before a platform release also says what it is behind on
(the platform tools such as space-env, the kernel): they reach a machine when it restarts, which
suspending and resuming it does, and the machine’s Manage dialog in the portal says so too.
A minute before it is suspended, the machine gets a last call: space-env status says so, and in
images with an agent session the notifier types a line into it. Anything that keeps the
machine in use in that minute (a wake lock, a command, traffic) cancels the suspend and the idle
time starts over.
Nobody using it for 12 hours
Busy is not the same as used: a watch loop, a program that polls, a dev server’s idle CPU or a browser tab left open keeps a machine in use for days with nobody there. So a machine that has been running for 12 hours with no person using it gets a last call and is then suspended, whatever keeps it in use, wake locks included. A person using it means an SSH session, a console session or typing in one, or a chat message to its agent; the 12 hours count from the last of these, or from when it resumed. Using it during the last call keeps it running.
A machine whose idle timeout is never (always on) is left alone: that is a choice its owner made. The machine is suspended with the reason “nobody was using it”, and its owner gets a notification.
While it runs, the machine’s page in the portal says how long it has been running, what an hour of it costs and when someone last used it (“Awake 3 d 4 h · 6 credits/h · last used 2 h ago”); on the canvas its hover card says the same, and what keeps it busy. Every morning the organization’s owners and admins get a notification listing the machines that cost credits in the last 24 hours while nobody used them.
Wake locks
A wake lock keeps the machine running while it looks idle: a quiet build, a long download that pauses, waiting for a person. Each has a name and an expiry (15 minutes by default, at most an hour); acquire it again before it ends to keep it. A holder that crashes stops refreshing and the lock lapses, so nothing keeps running by accident.
space-env wakelock acquire build --for 30m
space-env wakelock list
space-env wakelock release buildFor a single command, hold does the acquiring and releasing: it takes the lock, renews it
while the command runs, releases it when the command exits and exits with the command’s
status. The lock lasts 5 minutes past the last renewal (--for changes that), so if
space-env itself is killed, the machine can be suspended again soon after.
space-env wakelock hold build -- sleep 1A quiet build that may take a while, with a 10-minute lease:
space-env wakelock hold build --for 10m -- make releaseWake locks end with the machine: after a suspend or a reboot it holds none.
The agent images take one for Claude Code: its hooks acquire claude-turn for 15 minutes
when a prompt arrives and after every tool call, and release it when the turn ends, so an
agent’s machine is never suspended mid-turn, even while it waits on a quiet tool. An agent that
waits only for a message needs no lock: the message wakes it when it is sent with
--qos notify.