keepAlive is enabled, the box stays on between sessions instead of auto-pausing when idle. Use it when you need a box to remain continuously available, for example to host a server, keep a long-running agent ready, or preserve an always-on development environment.
For most workloads, the default Box lifecycle is still the better choice. Boxes auto-pause when idle and are more cost-efficient for bursty workloads unless keepAlive is enabled.
Create a keep-alive box
UsekeepAlive: true when creating the box:
Sizes and specs
Boxes withkeepAlive enabled use the same Box sizes as any other box. Pick the size with the size option when creating the box or in the Console during box creation.
| Size | CPU | Memory | Storage |
|---|---|---|---|
small | 2 vCPU | 4 GB | 5 GB |
medium | 4 vCPU | 8 GB | 10 GB |
large | 8 vCPU | 16 GB | 20 GB |
keepAlive is enabled or not.
Lifecycle differences
| Default behavior | With keepAlive: true | |
|---|---|---|
| Idle behavior | Auto-pauses when idle | Stays on |
| Pause / resume | Supported | Not supported |
| Best for | Bursty workloads, task runners, on-demand agents | Always-on servers, long-running agents, warm environments |
| Billing model | Active usage based | Open-time / always-on based |
keepAlive disabled.
Init command
Boxes withkeepAlive enabled can run a startup command whenever the box starts.
- starting a web server
- launching a background process
- preparing a long-running agent environment
- restoring a development workflow automatically after the box starts
keepAlive is enabled.
Console
In the Upstash Console you can:- enable Keep alive while creating a box
- choose the box Size
- manage the Init Command later from the box settings page
When to use keep alive
Use keep-alive when the box itself needs to stay available between requests:- hosting a dev server or preview app
- keeping an agent warm for low-latency use
- preserving a long-running environment with startup automation