Skip to content
Skip to content
PGB Learn

Scale to zero: how sleeping and waking works

Let idle containers sleep at no compute cost, wake on the next request, or keep one always online.

Updated Nov 12, 2026

A container does not have to run all day. With Scale to Zero, it sleeps after a period with no traffic, and wakes by itself when the next request arrives. A sleeping container stops using compute, so you are not billed for compute while it sleeps.

Choose how a container runs

  1. Open Containers and choose Configure on a container.
  2. Open Availability & Scaling.
  3. Under Availability Mode, choose:
    • Always Online: runs continuously and never sleeps. It is billed around the clock.
    • Scale to Zero: pauses after inactivity and costs nothing for compute while asleep.
  4. For Scale to Zero, set Sleep after inactivity for (in seconds).
  5. Optionally tick Restrict scale-to-zero to a time window. Pick a Timezone, Always Online From (Hour) and Until (Hour). Inside the window the container stays on, for example 8am to 10pm. Outside it, it may sleep after the inactivity period.
  6. Choose Save Container Attributes.

What a wake-up looks like

The first request to a sleeping container is held while it starts, then passed to your app once the health check passes. That first request is slower. The Console shows how much: after a wake, the message "Container woken ... ready" includes the latency in milliseconds. You can also choose Wake yourself before a busy period.

Slow-starting apps are shown honestly: the real wake time is recorded, with no fake cap.

Sleep & Wake Status

On a container's page, Sleep & Wake Status (with View History Log) lists each stretch of time the container was awake or asleep, newest first, with State, Started, Ended, Duration and Wake time. A wake starts an Awake row, and its Wake time is how long the first request waited for your app to answer.

A container's state shows as:

Badge Meaning
RUNNING Awake and serving
ASLEEP (Scale-to-Zero) or SNAPSHOTTED Stopped to save cost, wakes on the next request
DEPLOYING A build or deploy is in progress
STOPPED Not running
SUSPENDED Stopped because it reached its disk limit. Redeploy after clearing space

Make wake-ups fast

  • Keep your Health Check Endpoint cheap. It should answer as soon as the app can serve traffic.
  • Do heavy start-up work lazily, after the first request is answered.
  • Use a smaller image. It starts faster and can fall into a lower tier.
  • If your app must always answer instantly, such as an incoming webhook receiver, choose Always Online or a time window.

Good to know

  • Files your app wrote are kept while it sleeps and wakes.
  • Memory is not kept. Anything held only in memory is gone after a sleep, so save what matters to your database or storage.
  • Scheduled work inside the container does not run while it sleeps. If something must happen on a schedule, create a Cron Job with an HTTP target that calls your container's address. The request wakes it.
  • Disk use beyond the included amount is billed, and there is a hard cap. A container that reaches the cap is paused until you clear space and redeploy it.

More guides in Console: containers & domains