Skip to content

Suspend and wake

A sandbox that does nothing still holds memory and, more important, its GPU. A suspension saves its files and releases both. The next call wakes it with the same ID.

  1. You give a sandbox an idle time, for example --suspend-after 10m.
  2. When the sandbox runs nothing for that time, the daemon saves its files and removes its container. The GPU is free for other sandboxes.
  3. The next command, file operation, snapshot or fork wakes the sandbox. It gets its files back, on free GPUs that match its first request.
Terminal window
boxfork create --gpu 1 --suspend-after 10m
boxfork serve --gpu-idle-suspend 15m # the same for each GPU sandbox

Suspension is off unless you ask for it.

On a Google Cloud VM with an NVIDIA L4, a GPU sandbox with --suspend-after 10s released the GPU after 40 seconds idle. The next command got the files and the GPU again in 516 ms. This was one run, not a median (gcp.md).

  • A suspension keeps files only. Processes do not stay.
  • The daemon does not suspend a sandbox in which a process still runs.
  • The daemon does not suspend a sandbox whose image keeps a directory in a volume of its own, for example a database image. Mount a volume of your own at that directory.
  • The first call after a suspension waits for a full start of a container.