---
title: "Probes and load signals"
description: "The unauthenticated /healthz, /readyz, /loadz and /gatewayz endpoints, what each field means, and how an external autoscaler should read them."
url: "https://opod.io/docs/core-reference/probes/"
markdown_url: "https://opod.io/docs/core-reference/probes.md"
section: "Core reference"
last_updated: "2026-11-08"
---

# Probes and load signals

> The unauthenticated /healthz, /readyz, /loadz and /gatewayz endpoints, what each field means, and how an external autoscaler should read them.

## In short

A leader publishes `/healthz` (liveness), `/readyz` (readiness) and `/loadz` (load numbers for an autoscaler), with no key. Opod scales nothing itself: an external scaler reads `/loadz` and adds or removes workers. `OPOD_PROBE_LISTEN` serves the probes on a second, always-plain port.

```bash
curl -s http://localhost:8080/loadz | jq '{queue_depth, kv_used_pct, in_flight}'
```

Opod scales nothing itself. A leader publishes the numbers an external scaler needs, and routes across the workers it has. These endpoints need no key and carry no prompts, keys or key ids.

With `OPOD_PROBE_LISTEN=:8081` (or `probe_listen`), `/healthz`, `/readyz`, `/loadz` and `/metrics` are also served on a second listener that is always plain HTTP, whatever TLS the main listener speaks. Nothing authenticated is routed to that port.

## GET /healthz

Liveness. Answers `200` with body `ok` while the process serves HTTP. A worker serves its own `/healthz` on `:8081`.

## GET /readyz

Readiness: can this leader serve a request now?

| Answer                                                  | When                                                                    |
| ------------------------------------------------------- | ----------------------------------------------------------------------- |
| `200`, body `ready`                                     | The leader's own engine is healthy.                                     |
| `200 {"status":"ready","mode":"router-only"}`           | No local engine, and at least one live worker has a ready placement.    |
| `200 {"status":"ready","mode":"shard-coordinator"}`     | A gang has a ready coordinator and every part on a live node.           |
| `200 {"status":"ready","mode":"sleeping-workers"}`      | Every live worker sleeps on purpose. A request wakes one.               |
| `200 {"status":"ready","mode":"sleeping"}`              | The plan scales to zero (autoscale floor `0`) and everything is parked. |
| `200 {"status":"ready","mode":"waking"}`                | Same plan; workers are registered but none serves yet.                  |
| `503 {"status":"degraded","engine":"…","placements":0}` | Nothing can serve, and the plan does not sleep by design.               |

The sleeping and waking modes answer `200` on purpose: the leader must stay in its load balancer so a request can reach it and get the honest `503` + `Retry-After` that wakes the workers.

## GET /loadz

One JSON object, aggregated over the workers that hold the leader's model. The typed shape is `Load` in core's [`pkg/adminapi`](https://github.com/opod-io/opod-core/tree/main/pkg/adminapi).

```json
{
  "plan_revision": 7,
  "plan_model": "qwen2.5-7b-instruct",
  "in_flight": 9,
  "queue_depth": 3,
  "kv_used_pct": 71,
  "kv_busy_workers": 1.6,
  "tokens_per_s": 412.5,
  "prefix_hit_pct": 38,
  "rpm_1m": 240,
  "unavailable_1m": 0,
  "last_request_unix": 1761818000,
  "workers": 3,
  "reporting": 3,
  "ttft_p50_ms": 180,
  "ttft_p95_ms": 640,
  "ts": 1761818001
}
```

| Field                                                                                                                              | Meaning                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | For a scaler                                                                                                                     |
| ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `queue_depth`                                                                                                                      | Requests accepted and waiting, summed over workers.                                                                                                                                                                                                                                                                                                                                                                                                                                    | The leading signal: above 0 means demand exceeds capacity.                                                                       |
| `kv_used_pct`                                                                                                                      | The busiest worker's KV-cache use.                                                                                                                                                                                                                                                                                                                                                                                                                                                     | The ceiling: grow before the cache fills.                                                                                        |
| `kv_busy_workers`                                                                                                                  | Mean KV-cache use × the units a scaler adds: how many workers' worth of cache is in use. From core v0.4.6 a gang counts once, whatever its part count (one 2-part gang at a full cache reads 1); up to v0.4.5 each part counted (it read 2). Always present.                                                                                                                                                                                                                           | The proportional form, for `ceil(metric ÷ target)`.                                                                              |
| `in_flight`                                                                                                                        | Requests being served now.                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Smooth growth signal.                                                                                                            |
| `unavailable_1m`                                                                                                                   | `/v1` requests answered `5xx` in the last minute, chiefly `503 waking`.                                                                                                                                                                                                                                                                                                                                                                                                                | The wake signal for an endpoint at zero workers.                                                                                 |
| `rpm_1m`                                                                                                                           | Requests in the last minute.                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Keeps one worker alive under a trickle.                                                                                          |
| `last_request_unix`                                                                                                                | The last request's time.                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Idle detection.                                                                                                                  |
| `workers`, `reporting`                                                                                                             | Workers that can take a request now / whose sample is under 30 s old. Drained, lost and sleeping workers are not counted.                                                                                                                                                                                                                                                                                                                                                              | `reporting < workers`: the numbers are partial; prefer no decision.                                                              |
| `ttft_p50_ms`, `ttft_p95_ms`                                                                                                       | Time to first token over the last minute (at most 4096 answers), streamed answers only, measured from arrival at the leader. Always present; `0` = not measured, never "instant".                                                                                                                                                                                                                                                                                                      | What a user feels. A good secondary target.                                                                                      |
| `tokens_per_s`, `prefix_hit_pct`                                                                                                   | Throughput and prefix-cache hits.                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Reporting.                                                                                                                       |
| `plan_revision`, `plan_model`                                                                                                      | What the mounted plan says.                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Confirms which revision the leader observes.                                                                                     |
| `engines_unhealthy`, `engine_issue`                                                                                                | Workers holding a card while their engine is not serving (crash-looping, restarting, stopped), and the worst one's last message. Omitted when 0.                                                                                                                                                                                                                                                                                                                                       | Do not count these as capacity.                                                                                                  |
| `prefix_index`                                                                                                                     | `{workers_reporting, blocks}` of the prefix-cache block index, and from core v0.4.0 `cpu_blocks` (blocks in the workers' CPU tiers; omitted at 0). Omitted when nothing reports.                                                                                                                                                                                                                                                                                                       | Reporting.                                                                                                                       |
| `kv_capacity_tokens`, `kv_used_tokens`, `preemptions_total`, `evictions_total`                                                     | What the engines say they allocated and did, summed. Omitted while no engine states them.                                                                                                                                                                                                                                                                                                                                                                                              | Sizing: rising preemptions mean the pool is too small.                                                                           |
| `prefix_hit_tokens_total`, `prefix_query_tokens_total`                                                                             | From core v0.4.1. The engines' prefix-cache counters, summed over the samples that state them (vLLM): prompt tokens served from the cache, and prompt tokens looked up. Omitted while no engine states them.                                                                                                                                                                                                                                                                           | Their ratio is `prefix_hit_pct`; two reads give the hit rate over the window between.                                            |
| `tier_hit_tokens_total`, `tier_query_tokens_total`, `tier_load_bytes_total`, `tier_store_bytes_total`, `tier_alloc_failures_total` | The engines' host-memory KV tier counters, summed over the samples that state them: tokens the tier served, tokens looked up in it, bytes loaded from and stored to it, and allocations that failed. Omitted while no engine states them.                                                                                                                                                                                                                                              | Reporting: hits ÷ queries is the tier's hit rate.                                                                                |
| `tier_used_pct`                                                                                                                    | The fullest host KV tier's fill (a maximum, like `kv_used_pct`). Omitted while no engine states it.                                                                                                                                                                                                                                                                                                                                                                                    | A full tier evicts.                                                                                                              |
| `tier_ghost`                                                                                                                       | What a host KV tier would have served, measured from the engines' cache events: `{block_size, stored_blocks, returns: [{max_depth_blocks, blocks}]}`. `stored_blocks` counts the blocks the engines computed; each `returns` bucket counts evicted blocks that were computed again, by how many evictions passed before they came back. Buckets ascend. A tier of T blocks would have served every bucket whose `max_depth_blocks` ≤ T. Omitted when no worker publishes cache events. | Sizing a tier.                                                                                                                   |
| `engine_ttft_p50_ms`                                                                                                               | The engines' own median time to first token.                                                                                                                                                                                                                                                                                                                                                                                                                                           | `ttft_p50_ms` minus it is what the leader and network add.                                                                       |
| `admission_bound`                                                                                                                  | `slots` or `kv`: which bound the admission gate holds the model to. Omitted when unbounded.                                                                                                                                                                                                                                                                                                                                                                                            | `kv` with a growing queue: the KV pool is the limit.                                                                             |
| `auth_snapshot`                                                                                                                    | The mounted [auth snapshot](https://opod.io/docs/core-reference/auth-snapshot/) in force: `revision`, `issued_at`, `age_s`, `max_age_s` (the policy bound, `0` = none), `stale`, `keys`, `revoked_keys`. Omitted on a leader with no snapshot.                                                                                                                                                                                                                                         | `stale: true` means keyed `/v1` traffic is refused until a fresher snapshot arrives.                                             |
| `load_samples`                                                                                                                     | From core v0.4.4. Per worker the picker ranks: `source` (`pull`, or `heartbeat` for a worker whose core has no `/v1/load`), `age_ms` and `ranked` (`false` once a pulled sample is older than three `loadRefreshMs` intervals). The same map is on `/gatewayz`. Omitted before any pull answers.                                                                                                                                                                                       | `ranked: false` for a worker: it is scored on its in-flight count alone until a fresh sample lands.                              |
| `sessions`                                                                                                                         | From core v0.4.4. Over the last minute: `requests_1m` (requests that named a conversation with `X-Opod-Session` or the `user` field), `pin_hits_1m` (landed on the worker their pin named), `pin_moves_1m` (the pinned worker was saturated, full or gone, so the pin moved) and `route_tokens_1m` (echoed route tokens that verified). Absent while `routing.session` is off. Each door counts its own.                                                                               | `requests_1m` 0 while `rpm_1m` is not: no caller sends a session, so behind front doors a conversation does not keep its worker. |
| `slow_workers`                                                                                                                     | Arrives in the core release after v0.4.8. The workers this router ranks down for latency under `routing.slowFactor`: `worker` (node id, or `shard:<model>:<gang>`), `model`, `factor`, `metric` (`ttft_per_1k_tokens` or `inter_token_gap`), `samples`. Each door lists its own. Omitted when none is.                                                                                                                                                                                 | A listed worker serves less until its answers are normal again; look at its card's power, clocks and link.                       |
| `spec_draft_tokens_total`, `spec_accepted_tokens_total`, `spec_accept_pct`                                                         | From core v0.4.5, while an engine speculates (`plan.speculative`): the tokens its proposer offered and the ones the model kept, summed over the workers (vLLM and llama.cpp count them), and the engines' own recent acceptance rate, 0–100, averaged (SGLang states a rate and no counters). Absent when nothing speculates.                                                                                                                                                          | Kept ÷ offered is the acceptance rate; a low one means speculation costs more than it saves for this traffic.                    |

CPU and memory are not useful for GPU workers and are not published.

For a gang, the engine signals come from the gang's coordinator; one coordinator sample counts once in `reporting`.

### Rules for a reader

1. Poll every 10 seconds or so. The numbers are one-minute aggregates or gauges, never counters to difference.
2. An unreadable `/loadz` is not a reason to act. A leader restarting must not cause a scale-in.
3. Never scale in while `queue_depth > 0`. Give scale-in a stabilisation window.
4. Treat `unavailable_1m > 0` as activation, separately from the value you scale on.

### Probes are not customers

Mark a health-check request with `X-Opod-Probe: 1`. It is served like any request but counted in none of `in_flight`, `rpm_1m`, `unavailable_1m` or the idle clock, so it cannot wake what a scaler parked.

## GET /gatewayz

The front-door view. Not part of the stable contract.

On a **leader**:

| Field                                   | Meaning                                                                                                                                                                                                                                                                                                                       |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `role`                                  | `leader`.                                                                                                                                                                                                                                                                                                                     |
| `doors`, `doors_reporting`              | Doors counted (the leader's own front included, so never 0), and how many pushed inside the liveness window.                                                                                                                                                                                                                  |
| `doors_in_flight`, `doors_rpm_1m`       | The endpoint's totals across doors.                                                                                                                                                                                                                                                                                           |
| `in_flight_per_door`, `rpm_1m_per_door` | The totals divided by the doors, rounded up. Compare these with a per-door target.                                                                                                                                                                                                                                            |
| `live_for_s`                            | How long a silent door still counts.                                                                                                                                                                                                                                                                                          |
| `spend_lag_bound_s`                     | How old a door's view of the door count may be.                                                                                                                                                                                                                                                                               |
| `gateways`                              | The doors heard from: `[{gateway, live, last_push_s, last_push_ts}]`, sorted by name.                                                                                                                                                                                                                                         |
| `admission`                             | What the admission gate promises across doors. See below.                                                                                                                                                                                                                                                                     |
| `load_samples`                          | Per worker node id, the sample this process's picker ranks it on: `source`, `age_ms`, `ranked` for a `pull` entry; `source` and `why` for a `heartbeat` entry, which gains `ranked` from core v0.4.4. `/loadz` carries the same map from core v0.4.4. It is this process's own: the leader's map does not include the doors'. |

`admission` on a leader:

| Field                         | Meaning                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `classes`                     | `true` when the policy lists admission classes; `false` = every request is `standard`.                                                                                                                                                                                                                                                                                         |
| `scope`, `slot_scope`         | Always `per_door`. Each door ranks only the requests it holds and counts only the requests it dispatched. Doors do not coordinate.                                                                                                                                                                                                                                             |
| `flow_share_skew_max`         | The door count. A flow that reaches every door can be served up to this many times as often as a flow of its class that reaches one door.                                                                                                                                                                                                                                      |
| `class_order_across_doors`    | `true` only with one door. With more, a lower class held at one door can be served while a higher class waits at another.                                                                                                                                                                                                                                                      |
| `worker_slots_overcommit_max` | The door count. A worker can be sent up to this many times its slots at once; the excess waits in its engine's queue.                                                                                                                                                                                                                                                          |
| `governed_by`                 | `worker_slots`.                                                                                                                                                                                                                                                                                                                                                                |
| `models`                      | Per model id: `slots` (governed slots across workers that take requests now), `in_flight` (requests holding a slot), `stranded` (in flight on a worker that left the pool; they hold none of its slots), `held` (requests waiting), `ungoverned_workers` (workers or gangs serving with no slot count, so admission is unbounded), `servable` (`false` = no worker can serve). |
| `ungoverned_workers`          | Node ids of live workers that report no slot count.                                                                                                                                                                                                                                                                                                                            |

With one door every bound is exact.

On a **front door** (`--role gateway`):

| Field                                          | Meaning                                                                                                                                               |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gateway`                                      | This door's id (`OPOD_GATEWAY_ID`, default the hostname).                                                                                             |
| `registry_fresh`, `registry_age_s`             | Whether the mirrored worker list is under 30 s old, and its age. `false` with age `0` = the door never reached the leader.                            |
| `usage_queued`, `usage_sent`, `usage_dropped`  | The usage push backlog: rows waiting, rows the leader took, rows dropped. The queue holds 20,000 rows; above that the oldest are dropped and counted. |
| `spend_age_s`, `spend_lag_bound_s`             | How old the door's spend snapshot is, and the bound the leader published. Older than the bound: its door count is stale.                              |
| `doors`                                        | The door count from the last spend snapshot.                                                                                                          |
| `admission`                                    | As on a leader, computed with this door count.                                                                                                        |
| `load_samples`                                 | This door's own picker samples, as on a leader.                                                                                                       |
| `registry_error`, `usage_error`, `spend_error` | The last error of the registry mirror, the usage push and the spend poll. Omitted when empty.                                                         |

A cell door (`--role door`) answers `/gatewayz` with its routes instead: `role` (`door`), `routes_file`, `routes_loaded`, `routes_revision`, `routes`, `auto_routes`, `routes_age_s`, `routes_error`, `aliases` and `auto_aliases`.

## Worker probes

A worker serves both on its own port (`:8081`), without a key:

- `/healthz`: `200 ok` while the process serves HTTP.
- `/readyz`: `503 not joined: …` until the leader accepted the worker's heartbeat; `503 engine: …` when its engine does not answer; from core v0.4.3, `503 engine warming up: …` until the engine has answered one generation; else `200 ok`. `/readyz?join=only` skips the engine check.
