Understanding Knative: How Scale to Zero actually works
Explore the Activator, queue-proxy, concurrency targets, scaling windows and cold starts in Knative Serving.

On this page
A service with zero replicas cannot receive a request. At least, not by itself.
This is the awkward detail behind every serverless platform. Something must remain available to accept traffic while the application is absent. Something must decide that the application should exist again. And something must hold or reject requests while infrastructure catches up.
In Understanding Knative: Bringing Serverless to Kubernetes , we introduced Knative Serving. Now we follow the request through its control and data planes. The interesting part is not the replica count. It is the coordination required to make zero a useful operating state.
The components that remain awake
Knative Serving uses a networking integration to expose a Revision. Each application Pod includes a queue-proxy sidecar. The Knative Pod Autoscaler (KPA) uses observed demand to adjust the desired replica count. The Activator provides a request path when the Revision lacks sufficient available capacity. Controllers reconcile the corresponding Kubernetes resources.

At zero replicas, the ingress routes traffic through the Activator. It can buffer requests subject to timeouts and capacity limits, report demand and forward traffic once ready backends become available. It does not itself provision a machine or directly start a container. Kubernetes controllers, the scheduler, kubelet and runtime still perform those tasks.
When sufficient capacity is available, the networking path can bypass the Activator. Whether that happens depends on the configured target burst capacity and the Revision’s state. The queue-proxy remains in the request path even when the Activator is bypassed.
Concurrency is not CPU utilization
The default KPA metric is request concurrency. A request occupies concurrency while it is in flight, not merely when it arrives. A service processing 100 requests per second with an average duration of 200 milliseconds has approximately 20 concurrent requests in steady state. This follows Little’s law, assuming a stable system.
An illustrative capacity estimate is:
concurrency = request rate × mean request duration
replicas = ceil(concurrency / effective target)A target of 10 with 70% target utilization gives an effective target of 7. Twenty concurrent requests would therefore suggest three replicas. This is a simplified estimate, not the full KPA algorithm. Actual scaling incorporates measured windows, rate limits, readiness, bounds and panic behavior.
The containerConcurrency field sets a hard per-container concurrency limit when positive; zero means no hard limit. The autoscaling target is a soft operating target. The effective target is constrained by the hard limit when one is configured. Setting both to the same value does not mean every replica will operate continuously at that value.
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: concurrency-demo
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/target: "10"
autoscaling.knative.dev/target-utilization-percentage: "70"
autoscaling.knative.dev/min-scale: "0"
autoscaling.knative.dev/max-scale: "20"
spec:
containerConcurrency: 10
containers:
- image: ghcr.io/knative/helloworld-go:latestThe image is illustrative; pin a verified digest before production use. A low hard limit protects an application that cannot process many simultaneous requests, but increases the likelihood of queuing during a burst.
Stable and panic windows
KPA observes demand over a stable window (commonly 60 seconds by default) and a shorter panic window (commonly 10% of the stable window). The stable window smooths fluctuations. Panic mode reacts to a sufficiently large short-term increase in demand; the commonly documented default panic threshold is 200% of target capacity. While in panic mode the autoscaler avoids scaling down. These defaults are configurable and should be checked against the installed release.

This is not two independent autoscalers fighting over a Deployment. It is one scaling mechanism using different observation horizons. The short window reduces reaction time; the longer window reduces oscillation. Neither makes a container start faster.
The cold-start critical path
Activation latency includes routing, detection of demand, reconciliation, scheduling, image availability, container startup and readiness. Some stages overlap. If the cluster lacks capacity, node provisioning may dominate all the other stages combined.
Measure the first request after a verified scale-to-zero separately from warm requests. Record image cache state, node availability and application readiness. A single curl result is not a benchmark. Repeat the experiment and report a distribution, including failures and timeouts.
Experiment with the capacity model
Concurrency and activation model
Idealized steady-state estimate, not KPA emulation.
Additional replicas become ready at evenly spaced times between the startup delay and the end of the startup spread (a single additional replica uses only the delay). The dotted curve is a visual trend, not a fractional replica count or measured throughput. Ignores queues, panic windows and capacity limits. Scale-down timing is not modeled.
The simulator estimates steady state replica demand and illustrates the impact of a startup delay on an idealized burst. It is deliberately not an implementation of KPA: it does not simulate panic transitions, queue limits, routing or real controller timing.
Try increasing request duration without changing request rate. Then reduce the concurrency target. Finally, compare a zero-replica starting state with one warm replica. The experiment demonstrates why throughput alone is an inadequate scaling signal.
Observing the real control loop
With a working Serving installation and the example Service deployed, inspect the Revision and its backing resources:
kubectl get ksvc,revision,podautoscaler -n default
kubectl get pods -l serving.knative.dev/service=concurrency-demo -w
kubectl get events --sort-by=.metadata.creationTimestamp
kubectl -n knative-serving get configmap config-autoscaler -o yamlGenerate traffic through the Service URL using the configured ingress. Stop traffic and observe the scale-down transition. Do not expect zero immediately after the final request: stable windows, grace periods and retention settings influence the transition. A configured minimum scale above zero prevents this experiment from reaching zero.
Zero is a trade-off, not a goal
A minimum replica count of one can be cheaper than repeatedly violating latency objectives. Conversely, keeping hundreds of rarely invoked services warm can waste substantial resources. Choose the policy per Revision based on latency budgets, workload shape and startup behavior. Scale-to-zero removes application replicas, not the cost of the shared control plane, networking or necessarily the worker nodes.
The next article moves from HTTP demand to asynchronous events. Knative Eventing changes the question from when to start a service to how to deliver work to it reliably.


