Leave a sandbox idle
You do not need to send keep-alive requests. An idle sandbox can sleep after about 60 seconds without activity, and a later command or file operation wakes it. Servers, background jobs, and active connections keep it awake while they are in use. To sleep a sandbox yourself:sandbox.wake() wakes it immediately, which is useful before a burst of work.
sleep() returns whether this call put the sandbox to sleep. A busy sandbox —
one running foreground work, background processes, or an exposed port — stays
awake; archive it instead to stop a busy sandbox. Sleeping sandboxes keep their
memory on the host and count toward your organization’s active sandbox limit,
and sleep is not a durable checkpoint: use a snapshot or archive to retain
recoverable work.