Auto Suspend and Wake-up
Use --idle-timeout when creating a runtime to suspend it after a period
without observed activity. The value is in seconds. This example includes a
--publish rule because HTTP ingress traffic can wake a suspended runtime when
traffic returns.
Create the smallest useful example with a 30 second idle timeout:
runta run \ --name idle-demo \ --cpus 1 \ --memory 512 \ --publish 8080/https \ --idle-timeout 30Start a simple HTTP server in the runtime:
runta exec idle-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.shAfter 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 idle-demoSend another request to wake the runtime. The wakeup path restores the runtime and then proxies the original request:
curl https://<runtime-id>.runta.sh