Sleep and wake

Services outside production sleep when no one uses them, cost nothing while asleep, and wake on the next request.

When a service sleeps

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:

ServiceSleepsWakes
A web service with a public addressafter 15 minutes without a requeston its next request
A databaseonce every web service with a public address beside it is asleepwhen one of them wakes
A web service with no public addressthe same way as a databasethe same way as a database

Waking

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.

Waking a database

A database tunnel to a sleeping database stops with an error. Add --wake to wake it and connect, with the CLI:

Terminal
ghaym cloud connect db --env staging --wake

While 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.

What sleep costs

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.