Scenario

Health probes that add load

L2WorkingIncident15 minDebuggingDesign review

RolesInference EngineeringCustomer AI DeploymentAI Evaluation and Reliability

Engine
SGLang 0.5.22 against vLLM 0.31.0
Model
Qwen/Qwen3-8B
Hardware
one L4 with 24 GB of memory

Situation

A platform team runs SGLang pods on Kubernetes. The liveness probe asks /health every few seconds with a short timeout, and a failed probe restarts the pod. During a traffic spike the busiest pods restart in a loop. A probe times out, the pod is killed in the middle of its answers, its users move to the other pods, and the next busiest pod fails its probe. The service recovers only when the spike passes.

The scheduler log of a restarted pod shows the probes themselves, as prefill batches of one token between the user requests. The ticket proposes two changes: a longer probe timeout and a higher memory limit for the pod.

Questions

  1. Read the log around the ready line. What did the server do when the probe asked for its health, and what does that cost under load?
  2. Name the three endpoints and the question that each one answers.
  3. The code says that the probe costs nothing when the server is busy. Why is that true for the work and false for the timing?
  4. Design the probes: readiness, liveness and a deep check. Give the endpoint, the setting, the timeout and what happens on a failure.
  5. The other engine answers its health route without generating. What does that change for a deep check there?
  6. A restart in the middle of answers also needs a clean stop. Which signal, to which process, and how long do you wait?

Commit to a cause after each listing. Write it down before you read the next one.

Evidence

1/5

the health probe around the ready line of our L4 server

Read the line before the last one, and ask what sent that batch.

evidence/probe-in-the-log.txt
[2026-10-17 14:43:37] INFO:     127.0.0.1:58250 - "GET /health HTTP/1.1" 503 Service Unavailable
[2026-10-17 14:43:38] INFO:     127.0.0.1:58266 - "GET /model_info HTTP/1.1" 200 OK
[2026-10-17 14:43:38] Prefill batch, #new-seq: 1, #new-token: 6, #cached-token: 0, token usage: 0.00, #running-req: 0, #queue-req: 0, #pending-token: 0, cuda graph: True, input throughput (token/s): 3.37
[2026-10-17 14:43:38] INFO:     127.0.0.1:58272 - "POST /generate HTTP/1.1" 200 OK
[2026-10-17 14:43:38] INFO:     127.0.0.1:58288 - "POST /freeze_gc HTTP/1.1" 200 OK
[2026-10-17 14:43:38] The server is fired up and ready to roll!
[2026-10-17 14:43:40] Prefill batch, #new-seq: 1, #new-token: 1, #cached-token: 0, token usage: 0.00, #running-req: 0, #queue-req: 0, #pending-token: 0, cuda graph: False, input throughput (token/s): 0.58
[2026-10-17 14:43:40] INFO:     127.0.0.1:58298 - "GET /health HTTP/1.1" 200 OK

Source: manuals/sglang-101/capture/gpu/out-l4/server-default.log, lines 36-43

2/5

the three health endpoints and the two settings behind them

Find the endpoint that sends no request to the model, and the default of the generation setting.

evidence/three-endpoints.txt
- `/ready` returns 200 when the tokenizer manager is ready and 503 before that.
- `/health` and `/health_generate` share one handler. They return 503 while the server starts and while it shuts down.
- Otherwise the handler sends a one-token request with `max_new_tokens` 1 and waits for any output from the detokenizer.
- `SGLANG_ENABLE_HEALTH_ENDPOINT_GENERATION` defaults to true, so a plain `/health` also generates that token.
- The wait is `SGLANG_HEALTH_CHECK_TIMEOUT`, 20 s by default. With no output in that time, the handler marks the server `UnHealthy` and returns 503.

Source: manuals/sglang-101/sections/7-1-operating-sglang.md, lines 86-90

3/5

what the code claims and what two incidents showed

Separate the claim about the work from the claim about the timing.

evidence/the-docstring-and-the-incident.txt
The docstring says that the probe request costs nothing when the server is busy, because any output from the scheduler counts as proof of life. That is true for the work, and false for the timing. **A real incident:** issue #22511 reports "health check failed. server could not get a response from detokenizer for last 20 seconds" on GLM-5 with 2 H800 GPUs under high load, on v0.5.10 {{issue #22511}}. A related issue, #35884, found that a timed-out probe left its request in the scheduler, so failed probes accumulated {{issue #35884}}.

Source: manuals/sglang-101/sections/7-1-operating-sglang.md, lines 92-92

4/5

the routes of a vLLM server with an API key, with and without the key

Find the routes that answer without a key, and think about which of them touch the model.

evidence/the-other-engine.txt
/v1/models       nokey=401 key=200
/health          nokey=200 key=200
/metrics         nokey=200 key=200
/invocations     nokey=405 key=405
/version         nokey=200 key=200
/tokenize        nokey=405 key=405
/v2/x            nokey=401 key=404
/inference/x     nokey=401 key=404
/cohere/x        nokey=401 key=404
/ping            nokey=200 key=200
/load            nokey=200 key=200

Source: manuals/vllm-101/capture/gpu/out-l4/livecheck-2026-10-22.txt, lines 52-62

5/5

the first health check of a vLLM server after startup

No prefill batch follows the health request on this engine.

evidence/vllm-health-semantics.txt
INFO:     Application startup complete.
INFO:     127.0.0.1:35152 - "GET /health HTTP/1.1" 200 OK
INFO:     127.0.0.1:34616 - "GET /v1/models HTTP/1.1" 200 OK

Source: manuals/vllm-101/sections/1-2-check-that-the-server-is-healthy.md, lines 23-25

The answer

Show the walkthrough

Read the eight log lines in order. At 14:43:37 the probe asked /health and got a 503, because the server was still starting. The server then sent itself one request to /generate, froze the garbage collector, and printed the ready line. Two seconds later the scheduler logged a prefill batch of one new token, and right after it the probe got its 200. Nothing else was running. That one-token batch was the probe. By default /health does not only answer, it sends a request through the model and waits for the result.

The second listing names the three endpoints. /ready returns 200 when the tokenizer manager is ready, and it sends nothing to the model. /health and /health_generate share one handler: they return 503 while the server starts or shuts down, and otherwise they send a one-token request with max_new_tokens of 1 and wait for any output from the detokenizer. SGLANG_ENABLE_HEALTH_ENDPOINT_GENERATION defaults to true, so a plain /health generates too. The wait is SGLANG_HEALTH_CHECK_TIMEOUT, 20 s by default, after which the handler marks the server unhealthy and returns 503.

The third listing is the subtle part. The docstring is right about the work: any output from the scheduler counts as proof of life, so a busy server does not need to finish the probe's token. It is wrong about the timing. The probe request waits in the same queue as the users, and when the first token of anyone takes longer than the probe timeout, the probe fails. The two incidents show both halves. One report saw the health check fail with no response from the detokenizer for 20 seconds, on a large model under high load. A second found that a timed-out probe left its request in the scheduler, so failed probes accumulated. Under a spike, the probe is a user who gives up after 20 s and tells the orchestrator to kill the server.

The last two listings are the other engine. Its /health, /ping and /load routes answer 200 without an API key, and its first health check after startup is followed by the model list, not by a prefill batch. The manual says why: that health route answers 200 when the engine runs and does not generate a token, so a 200 does not prove that a request completes. On that engine the health route is a liveness check by design, and a deep check means one short request.

Show the resolution

The probes were the incident. The liveness probe generated a token on every call, waited in the user queue, timed out under load and killed the busiest pod, which moved its load to the next pod.

Set /ready as the readiness probe, so a pod joins the service when it can accept requests. For liveness, set SGLANG_ENABLE_HEALTH_ENDPOINT_GENERATION=false, after which /health returns 200 without a request to the scheduler, and keep that probe on the pod. Move /health_generate to a slower deep check that alerts a person and restarts nothing. The probe timeout then stops mattering under load, and the memory limit was never the problem. On the other engine, use /health for liveness as it is, and make the deep check one short request.

Then fix the stop. Only a SIGTERM to the main process drains the running requests: the server returns 503 on /health during the drain, logs the remaining requests every 5 s, and exits when none remain. A signal to the whole process group or a forced exit stops work in progress. Set the termination grace period longer than the longest request at the output cap, and cap max_tokens first, or a drain can never finish in time.

Show the wrong turns
  • “Raise the probe timeout to a minute.”

    The probe still waits in the user queue, and a timed-out probe left its request in the scheduler in one report. A longer timeout hides the overload for longer and then kills the pod anyway.

  • “Raise the memory limit of the pod.”

    The pods did not run out of memory. They were killed by the orchestrator after a probe waited too long.

  • “Use the generating endpoint for liveness, because it proves that the model works.”

    A deep check that restarts the busiest pod under load is the incident. A deep check should alert a person.

  • “Kill the pod fast so the others take over.”

    A signal to the process group killed the scheduler child first and failed every running request. Only a SIGTERM to the main process drains.

Show the general rule

A probe is a client, and a client that waits in the same queue as the users will fail exactly when the users wait, which is when a restart hurts most. Separate the questions: can the process accept requests, is the process alive, and can the model produce a token. Give each question its own endpoint, its own schedule and its own consequence, and never let the slow question trigger a restart.

Taught in

The SGLang manual shows the probe in the log in the health page and gives the probe settings, the incidents and the drain in the operating page, the vLLM manual explains its health route in its health page and the production probes in the production page, and the SRE for AI lesson covers runbooks for this class of loop.