# Serverless & scale to zero

Serverless is a [service mode](/docs/services/service-modes) for web services with traffic that comes and goes. When no requests arrive, Koo scales the service to zero; the next request wakes it.

An idle serverless service shows **Sleeping** on the environment canvas. Sleeping is a normal state, not a problem — see [status](/docs/observability/status).

## Enable serverless mode

1. 
2. 
3.

Serverless can't be combined with a cron schedule or an attached volume — a web service runs in exactly one mode.

## The replica count becomes a ceiling

In serverless mode, the replica count in Settings no longer means a fixed count. It is the scale ceiling: Koo scales from zero up to that many replicas per location on demand, then back down to zero when the service is idle.

The floor is always zero and the ceiling is the replica count — there are no separate minimum and maximum settings, and nothing to tune. Sizes and replica counts are covered in [resources and scaling](/docs/services/resources-and-scaling).

## Sleeping and waking

When requests stop, the service goes to sleep and shows **Sleeping**. The next request wakes it: Koo starts a container and holds the request until the container is ready, then hands it to your app.

That first request pays the cold start — roughly your app's boot time. The faster your app boots, the shorter the wait, so keep startup light: a small image, quick initialization, and a health check that reports ready as soon as your app can take requests.

## Billing

Compute on paid plans is billed in arrears for the CPU and memory the service declares, for as long as the service exists — sleeping does not pause the meter. See [billing](/docs/account/billing) for how compute is rated.

## When not to use serverless

Serverless fits stateless request handling. It is the wrong mode when:

- 
- 
-
