DocsRun your app
Sleep and wake
An idle app sleeps after the time you pick and wakes on the next request. What that costs, what it saves and what an app loses while it sleeps.
Use with AI
An app that nobody visits does not have to run. It can sleep, and wake when the next request comes in. While it sleeps, you are not charged for compute.
How it works
Section titled “How it works”- The app is idle. No request has come in for the time you picked: one, two, three or five minutes.
- It sleeps. Its replicas stop. Nothing runs, and no compute is charged.
- A request arrives. The platform holds the request and starts a replica.
- It answers. The request goes through once the app listens. That first request waits for as long as your app takes to start.
An open WebSocket counts as a visitor: the app stays awake while a socket is open, and a socket that knocks wakes it. See WebSocket and Socket.IO.
The two settings
Section titled “The two settings”Both are under Settings, Scaling. A change applies with the next deployment.
| Setting | What it does |
|---|---|
| Keep one replica always on | Switched on, one replica runs all the time: no waiting, and jobs keep running. That replica is charged all month. Switched off, the app sleeps when it is idle and you pay only while it runs |
| Sleep after | How long the app waits without a request before it sleeps: 1, 2, 3 or 5 minutes. Five is the default. Only for an app that may sleep: with a replica always on it does nothing |
Sleep after
Section titled “Sleep after”A shorter time means less compute while nobody visits, and a start more often. What counts as a visit:
- A request that is still being answered keeps the app awake, however long it takes. So does a download or a stream that is still open.
- An open WebSocket keeps it awake until the socket closes.
- The platform’s own health checks do not count.
- A request for a hostname the app does not serve does not count either.
A request that arrives at the moment the app goes to sleep is answered: the platform starts the app again and the visitor waits as for any first request.
A replica the platform started for a deployment waits five minutes before its first sleep, whatever the setting, so a deployment is never cut short.
What an app loses when it sleeps
Section titled “What an app loses when it sleeps”A sleeping app is stopped. When it wakes, it starts like new:
- Memory is empty. Sessions, caches and counters kept in memory are gone. Keep them in a database or a store outside the app.
- Files it wrote can be gone. The disk of the app is temporary. See Express.
- Open connections are closed. The app connects to its database again when it starts.
Timers and jobs
Section titled “Timers and jobs”A sleeping app wakes only for a request. A timer, a cron job or a queue worker inside the app does not run while it sleeps.
If the app does work without a visitor, keep Keep one replica always on switched on. The dashboard reminds you when it finds a package for cron jobs or queues in your package.json.
With more than one replica, every running replica runs the job. Work that must happen once needs a lock in your own code.
For work that should happen on a schedule, once, without a visitor, use a cron job instead: it runs on a machine of its own, and the app can sleep in the meantime. For a queue worker or any command that keeps running, add a worker: it runs on a machine of its own too, always on or only while there is work, however the app sleeps.
A Valkey cache of the team sleeps on its own when nothing is connected to it, whatever held the connection, and wakes on the next connection with its data; asleep, it costs its persistence fee alone. Its own switch, Sleep when idle, keeps it running instead, so a connection never waits for it to wake.
A Postgres database sleeps after the idle time its team chose (1, 5 or 15 minutes, 5 unless changed) with nothing connected and wakes on the next connection; asleep, its compute costs nothing. An app that keeps querying it (a scheduler every minute, a queue on the database driver) keeps it awake all month. Its own switch, Sleep when idle, keeps it running instead, once the team has a plan.
Sleeping is not paused
Section titled “Sleeping is not paused”Pause is something you do by hand, under More actions. A paused app has no replicas and does not wake for a request. Visitors of its platform URL see a page that says the app is paused. It stays off until you choose Resume.
© 2026 Orbit