Skip to content

Auto Suspend and Wake-Up

Set auto suspend with timeout so runtimes automatically suspend after inactivity and wake on request, saving resources when no tasks are queued.

Terminal window
runta run \
--name demo \
--cpus 1 \
--memory 512 \
--publish 8080/https \
--idle-timeout 30

Start a simple HTTP server in the runtime:

Terminal window
runta exec demo -- sh -lc 'nohup python3 -m http.server 8080 >/tmp/http.log 2>&1 &'

Find the runtime ID and make one request:

Terminal window
runta ps -a
curl https://<runtime_id>.runta.dev

After the runtime has received no inbound HTTP traffic for the configured idle timeout, the coordinator will suspend it on a later idle scan. The default scan interval is 60 seconds, so a 30-second timeout can take roughly 90 seconds or more to show up as suspended:

Terminal window
sleep 100
runta inspect demo

Send another request to wake the runtime. The wake-up path restores the runtime and then proxies the original request:

Terminal window
curl https://<runtime_id>.runta.dev

Use the Runta CLI for terminal workflows, shell scripts, and direct runtime operations.

TaskCLI command
Create an auto-suspending published runtime runta run --name demo --cpus 1 --memory 512 --publish 8080/https --idle-timeout 30
Inspect runtime state runta inspect demo
Wake the runtime with traffic curl https://<runtime_id>.runta.dev