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.
runta run \ --name demo \ --cpus 1 \ --memory 512 \ --publish 8080/https \ --idle-timeout 30from runta import IngressSpec, Runta
runta = Runta()runtime = runta.runtimes.create( "demo", vcpus=1, memory_mib=512, ingress_specs=[IngressSpec(protocol="https", runtime_port=8080)], idle_suspend_after_secs=30,)import { Runta } from "@runta/runta-sdk";
const runta = new Runta();const runtime = await runta.runtimes.create("demo", { vcpus: 1, memoryMib: 512, ingressSpecs: [{ protocol: "https", runtimePort: 8080 }], idleSuspendAfterSecs: 30,});Start a simple HTTP server in the runtime:
runta exec demo -- sh -lc 'nohup python3 -m http.server 8080 >/tmp/http.log 2>&1 &'Find the runtime ID and make one request:
runta ps -acurl https://<runtime_id>.runta.devAfter 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:
sleep 100runta inspect demoSend another request to wake the runtime. The wake-up path restores the runtime and then proxies the original request:
curl https://<runtime_id>.runta.devQuick Reference
Section titled “Quick Reference”Use the Runta CLI for terminal workflows, shell scripts, and direct runtime operations.
| Task | CLI 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 |
Use these calls after creating or resolving a Python runtime handle such as runtime.
| Task | Python SDK |
|---|---|
| Create an auto-suspending published runtime | runta.runtimes.create("demo", ingress_specs=[...], idle_suspend_after_secs=30) |
| Inspect runtime state | runtime.refresh_info().status |
| Wake the runtime with traffic | httpx.get(f"https://{runtime.id}.runta.dev") |
Use these promise-based calls after creating or resolving a TypeScript runtime handle.
| Task | TypeScript SDK |
|---|---|
| Create an auto-suspending published runtime | await runta.runtimes.create("demo", { ingressSpecs: [...], idleSuspendAfterSecs: 30 }) |
| Inspect runtime state | (await runtime.refreshInfo()).status |
| Wake the runtime with traffic | await fetch("https://" + runtime.id + ".runta.dev") |