LearnQuestion bank

p99 latency of your LLM endpoint jumped from 4 s to 20 s overnight with no deploy. Debug it.

Applied LLMTechnicalMedium

Theme reported publicly: Spotify

Answer it yourself first, out loud or on paper, then compare.

Answer

Model answer, written in a candidate's voice

In short

  • Decompose p99 with traces: queueing, TTFT, generation time, retrieval/tool calls, network/provider.
  • Compare traffic mix: prompt/output length, request rate, model/route, tenants, and any upstream config/prompt/flag change despite no deploy.
  • Check provider degradation, rate limiting, retries, KV/GPU pressure and preemption, slow retrieval backend, and autoscaling cold starts.
  • Check output-length distribution for runaway generations without stop/max tokens and retry counts.
  • Mitigate fast: timeouts, output caps, fallback model, scale-out/queue shedding.
  • Root-cause from traces and metrics, then fix and add guardrails.

In full

I would not guess; I would decompose the p99 with traces into queue wait, TTFT, generation time, retrieval/tool calls, and network/provider latency, then compare the overnight window against the baseline. In parallel I would check the traffic mix: prompt and output length distributions, request rate, model/route, tenants, and any upstream config, prompt, or feature-flag change even though there was no deploy. I would also look for provider degradation or rate limiting with retries, KV/GPU pressure causing preemption, a slow retrieval backend, and autoscaling cold starts, and I would specifically check output-length distribution for runaway generations missing stop or max-token limits plus retry counts. While that is running, I would mitigate: tighten timeouts, cap outputs, add a fallback model, and scale out or shed load at the queue. Once the dominant component is identified, I would root-cause it, fix the cause, and add guardrails such as max tokens, stop conditions, retry budgets, and alerts on p99 by stage.

Checked against sources by an independent AI reviewer.

What a strong answer covers

  • Decompose with traces: queueing, TTFT, generation time, retrieval/tool calls, network
  • Hypotheses: traffic mix (longer prompts/outputs), provider degradation or rate limiting and retries, KV pressure causing preemption, slow retrieval backend, a config/prompt change upstream, autoscaling cold starts
  • Check output-length distribution (runaway generations without stop/max tokens) and retry counts
  • Mitigate: timeouts, fallback model, output caps, scale-out; then root-cause

Common mistakes

  • Looking at averages
  • blaming the model without checking queues and retries