Sleep and wake
Services outside production sleep when no one uses them, cost nothing while asleep, and wake on the next request.
All pages
A web service outside production goes to sleep after 15 minutes without a request. Production never sleeps. A sleeping service reads Asleep in the console.
The other services of an environment sleep with it:
| Service | Sleeps | Wakes |
|---|---|---|
| A web service with a public address | after 15 minutes without a request | on its next request |
| A database | once every web service with a public address beside it is asleep | when one of them wakes |
| A web service with no public address | the same way as a database | the same way as a database |
The next request wakes the service and is served once it's up. Waking a web service first wakes every sleeping database beside it, so the app never comes back to a dead connection. A deploy wakes the service too.
Sleep stops the service without removing it, so waking takes no new deploy. If your plan has no room for more awake compute, the wake is refused and the service stays asleep, and the console reads Asleep — held by plan limits.
A database tunnel to a sleeping database stops with an error. Add --wake to wake it and connect, with the CLI:
ghaym cloud connect db --env staging --wakeWhile the tunnel is open, the database stays awake. Database tunnels has the rest.
To watch a service's logs across a sleep, services logs with -f keeps the stream open while the service is asleep.
A service's compute bills only for its awake minutes, so a sleeping service bills no compute. A volume is stored whether the service is awake or asleep, and bills either way. Billing shows how awake minutes add up.