Idle Sleep
Idle sleep lets an environment scale its compute to zero when nobody is using it, and start again on the next visit. You pay for compute only while the environment is awake.
How it works
Section titled “How it works”- You enable idle sleep on an environment and choose an idle period (10 minutes to 24 hours, default 30 minutes).
- When the environment receives no requests for that period, the platform stops its containers.
- The next visitor sees a Quant Cloud loading page while the containers start. This usually takes one to three minutes, depending on your image size and start-up scripts.
- The page reloads automatically once the environment is ready.
What still runs
Section titled “What still runs”Only container compute sleeps. Databases, file storage, caches and load balancer rules keep running and keep billing.
Bots and crawlers
Section titled “Bots and crawlers”Simple bots and scanners do not wake a sleeping environment. Browsers do. Verified search engine crawlers (Googlebot, Bingbot and others) can wake it at most once per hour; between wakes they receive a temporary 503 with a Retry-After header.
Using idle sleep on production
Section titled “Using idle sleep on production”Once awake, every request keeps the environment awake, including crawler and bot traffic. A public production site rarely idles unless the traffic that does not need the origin is served elsewhere. Before enabling idle sleep on production:
- Enable static offload so cached pages are served from the edge.
- Add a rule that serves static content to crawlers.
- Accept that the first visitor after a quiet period sees the loading page.
Editorial environments for static sites are the best fit: the public site is served from the edge and the origin only needs to be awake while editors work.
Deploys and other actions
Section titled “Deploys and other actions”Starting, redeploying, or updating the compose configuration of a sleeping environment wakes it first. Cron runs, exec commands, backups and restores run as separate tasks and do not wake the environment.
Enabling idle sleep
Section titled “Enabling idle sleep”In the dashboard, open the environment and use the Idle sleep control. Through the API, PUT /environments/{environment}/idle-sleep with {"enabled": true, "idleMinutes": 30}.
