Unit 4 of 12 · about 4 hours · explain, measure

Weight loading, startup phases, warmup, readiness and graceful drain

Autoscaling and rollout math both rest on startup time and honest readiness. A server that reports ready before warmup, or dies with a full queue, voids every downstream guarantee.

You'll be able to

  • Split a cold start into provision, image, weight-load and warmup phases and name which dominates for a large model.
  • Wire liveness, readiness and inference-health probes with thresholds, and state what each gates.
  • Drain a server gracefully: stop admission, finish in-flight work, then terminate, without stranding billed requests.

Covers

Model formats, weight loading and startup phasesWarmup, health and readinessGraceful drain and process termination
1

Read

In this order, only the parts listed

0 of 6 done

  1. Cold starts and health checkingMachine Learning Systems, Volume 2 - Inference at Scale and Serving Fault Tolerance

    Autoscaling and Global Infrastructure, The cold start problem: equation 14, Table 39 load times by storage tier (SSD versus S3) and Example 1.21 (Llama-70B totaling 420s with a 300s S3 download); Load Balancing and Request Routing, Health checking and failover: the liveness, readiness and deep probe levels, Table 31 cadences and the warmup startup check (page read 2026-10-14)

  2. Containerization and cold startsInference Engineering - Chapter 7, Production

    Section 7.1 (printed pp. 179-183): base images, version pinning, large weights loaded separately; Section 7.2.2 (printed pp. 188-190): the four cold-start factors and the engine-startup trade-off between fast-start engines and compile-heavy ones

    Skip the vendor-specific image advice. Keep the startup-phase split and the pinning rule.

  3. Day 23 cold-start stages and frontier100 Days of LLM Inference - Days 22 to 26

    Part 2 cold_start_stages table for 70B FP16 (its printed 927s and 102s totals add both the vLLM and the TRT-LLM engine rows, which are alternatives; the vLLM path is 627s versus 72s) and the scale-to-zero frontier table; Try These Experiments 6: time vllm serve startup on a small model against the theory

  4. Project 103 deployment probesAI Infrastructure Engineer Learning - Project 103 LLM Deployment

    Container probes: livenessProbe on /health with initialDelaySeconds: 300, readinessProbe on /health with initialDelaySeconds: 60; resource requests with nvidia.com/gpu: 1, model-cache PVC and 8Gi shm volume

  5. vLLM health endpointvLLM Online Serving, Architecture and Production Metrics

    Instrumentator APIs, Basic APIs: /health health check (the v0.31.0 handler returns 200 while the engine answers and 503 once it is dead)

  6. Day 26 graceful drain100 Days of LLM Inference - Days 22 to 26

    Part 4 GracefulShutdown with drain_timeout=60 over 25 active requests, and its lifecycle line: preStop hook, deregister from the load balancer, drain, SIGTERM, then SIGKILL after the grace period

    The class only counts requests. Port the order, not the timings, onto your own server.

2

Focus on

  • Cold start is . For large models dominates: 140GB at S3 rates is minutes, and no scheduler tuning removes it.
  • Three probe levels answer different questions: liveness (is the process alive), readiness (weights loaded, GPU initialized, warmup done, dependencies up), deep inference health (a known input returns sane output). vLLM serves HTTP only after engine startup, so its /health 200 means started and not dead; it checks neither output nor your other dependencies.
  • Warmup is real work: dummy generations that compile graphs and fill pools before the first billed request. First-request latency without warmup measures compilation, not serving.
  • Drain order matters: fail readiness and deregister so no new traffic arrives, stop admission, finish in-flight work within the timeout, persist what must survive, then terminate. SIGKILL skips every step and strands billed work.
Common mistakes · 3
  • Reading /health 200 as proof of correct serving. vLLM's check means the engine started and has not died; a deep inference probe and your own dependency checks gate traffic beyond that.
  • Copying the Project 103 troubleshooting doc probe path without reading the manifest. The doc text names /ready while the deployment YAML probes /health; the manifest wins.
  • Baking large weights into the container image. That path is obsolete past small models; load hundred-gigabyte weights from near-GPU storage at startup instead.
3

Try it yourself

Closed-book, before checking anything

Time your local server from process start to its first /health 200 and to the first successful deep inference-health probe. Split the total into container, weight-load and warmup phases from the server log, and note that the HTTP port does not answer until engine startup ends.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.A Llama-70B server cold-starts in 420s. Which phase dominates, and what removes the most time?Answer

    Weight download at 300s over S3 dominates. Moving weights to in-node NVMe-class storage and shrinking them with quantization removes most of it; scheduler tuning removes almost none.

  2. 2.What does each probe level gate, and how often does it run?Answer

    Liveness gates process restart (10s interval, 5s timeout, 3 failures); readiness gates routing (5s, 3s, 2 failures); deep inference health gates silent corruption with a known input (30s, 10s, 1 failure).

  3. 3.Why must warmup finish before the first billed request?Answer

    The first generations compile graphs and initialize pools, so their latency reflects one-time setup. Billing or SLO-measuring them charges setup cost to the user.

  4. 4.A deploy sends SIGKILL to a server with 25 queued requests. What breaks that graceful drain would have saved?Answer

    In-flight generations lose their KV state and billed tokens, queued requests get no retryable rejection, and the load balancer keeps routing until its own health check notices. Drain deregisters and stops admission first, finishes in-flight work, then terminates.

5

Practice

  • 100 Days day23: startup timing experiment

    Try These Experiments 6: time vllm serve startup on a small model and reconcile each phase with the cold_start_stages table

    Record provision, image, weight-load and warmup separately. Then add a deep inference-health probe beside /health and state what each one proves.

You're done when

Your phase-split timing reconciles with the cold-start equation, and your probes distinguish alive, ready and correctly-inferring states.

Only when you can do this without notes.

Leads to

Notes

Resources · 5 for this unit, 8 more in the section
  • vLLM Online Serving, Architecture and Production MetricsvLLM Project · primary

    Trace the API server, engine core, scheduler, KV manager and model runner, then map documented metrics to your SLIs. The link is pinned to v0.31.0; add the auth, tenant, quality and rollout controls the engine leaves to you.

  • Machine Learning Systems, Volume 2 - Inference at Scale and Serving Fault ToleranceHarvard (Vijay Janapa Reddi) · required

    Read "Load Balancing and Request Routing", "Multi-Tenancy and Isolation" and "Autoscaling and Global Infrastructure" in Inference at Scale, then "Serving Fault Tolerance" and "Graceful Degradation" in the Fault Tolerance chapter.

  • Inference Engineering - Chapter 7, ProductionPhilip Kiely (Baseten Books) · support

    Read Chapter 7 for containers, autoscaling, cold starts, routing and queueing, zero-downtime deployment, cost estimation and client-side streaming. Skip the vendor section at its end.

  • 100 Days of LLM Inference - Days 22 to 26Elizabeth Thomas · support

    Use the container, autoscaling, routing, capacity and zero-downtime notebooks as small operational simulations. Replace calendar order and fixed scale targets with the stage checkpoint and your hardware limits.

  • AI Infrastructure Engineer Learning - Project 103 LLM DeploymentAI Infra Curriculum · support

    Use its Docker, API, monitoring, Kubernetes and cost files as scaffolding only. Check its resource assumptions against your own model and GPU, and rerun any benchmark before reusing a result.

Also in this section

  • Hands-On LLM Serving and Optimization - Chapters 3 and 4, serving system designChi Wang and Peiheng Hu (O'Reilly) · required

    Read Chapter 3 (an online service from scratch, batching with streaming, multi-model trade-offs) and the enterprise-architecture part of Chapter 4. Convert the designs into explicit request, model-lifecycle and failure state machines.

  • vLLM Production MetricsvLLM Project · required

    Define every selected queue, cache, phase and request metric, check histogram buckets and measure exporter overhead. Add model version, cancellation, rejection, quality sample and tenant-safe trace fields in the surrounding service.

  • Gateway API Inference ExtensionKubernetes SIG Network · required

    Study model-aware routing, endpoint selection and operational integration. Use it for architecture and an optional local deployment only after the service passes lifecycle and failure tests without Kubernetes.

  • SGLang documentation - Production MetricsSGLang Project · support

    Compare its metric names and phase boundaries with vLLM's, so your dashboards do not depend on one engine's vocabulary.

  • AI Systems Performance Engineering - Production Inference LabsChris Fregly · required

    Use Chapter 16 monitoring, cache health, capacity planning and load-test utilities, then Chapter 17 routing only if distributed. Add process death, overload and bad-version cases that the performance pairs do not cover.

  • LLM Inference Systems Laboratory - Operations and FailureRoadmap-Final · support

    Complete production gateway, isolation, telemetry, canary, drain, rollback and fault campaigns. Store first-cause timelines and revise runbooks from observed blind spots.

  • OpenAI API Reference - streaming, auth, rate limits and request IDsOpenAI · reference

    Read the chat streaming event shape with the [DONE] terminator, bearer auth, rate-limit headers, and x-request-id with caller-supplied X-Client-Request-Id. vLLM is the implementation under test; use this only for the contract it claims compatibility with.

  • vLLM Multimodal Inputs - media validation, fetch policy and cache identityvLLM Project · reference

    Read Online Serving for image, video and audio inputs: --allowed-media-domains, fetch timeouts, --limit-mm-per-prompt, local-media path restriction, and media UUIDs for cache identity. The link is pinned to v0.31.0.