How automatic sleep works
A VM becomes eligible for sleep when:- it has no open connections through the Vers proxy, and
- its last proxied connection ended at least five minutes ago (or it has never received one and was created at least five minutes ago).
The inactivity window is deployment-specific. Five minutes is the default.
What counts as activity
Activity means a connection routed through the Vers proxy, such as:- HTTP and HTTPS requests to the VM’s Vers hostname or custom domain
- WebSocket connections
- SSH connections to the VM’s public hostname
- raw TLS connections to a routed VM port
Wake on connection
New HTTP, WebSocket, SSH, and raw TLS connections wake a VM automatically. The first connection waits a few seconds while Vers restores the VM. If it is not ready within two minutes, the proxy returns an error.Control-plane requests, such as status and SSH-key requests, do not wake a VM and can return
409 Conflict. Connect directly to the VM to wake it.Keep a VM running
Keep-alive is off by default. Enable it for outbound-only or background work, or when wake latency is unacceptable. Enabling it on a sleeping VM does not wake the VM; it prevents sleep after the next wake.Enable keep-alive when creating a VM
Setkeep_alive when creating the VM:
Change keep-alive on an existing VM
Setkeep_alive to true on an existing VM (or false to re-enable automatic sleep):
Check sleep and keep-alive state
GET /api/v1/vms returns each VM’s state and keep_alive value:
state: "sleeping" means the VM is preserved and ready to wake on its next connection.
See also
- Networking — public hostnames, routed ports, and TLS
- VM access — SSH, command execution, and file transfer