KatInterview

Troubleshooting High Latency in a Production Microservice

System DesignModel answer
EasyModel answerSystem Designincident-responsesreobservability

Last updated

A guide on investigating and resolving a sudden 15x latency spike on a critical path service in a Kubernetes environment.

You are on call when an alert fires indicating that the 99th percentile (P99) latency for the Account-Profile-Service has jumped from 50 ms to 750 ms over a 10-minute window. This microservice is on the critical rendering path for the application's home feed.

Explain how you would systematically triage and remediate this incident:

  1. Scoping: What methods would you use to measure the blast radius and determine if the issue is global or isolated to specific cohorts (e.g., regions, versions, user segments)?
  2. Investigation: Which metrics, trace details, and logs would you inspect to differentiate between internal application bottlenecks (like thread starvation or garbage collection pauses) and external dependency issues (like database slowness or upstream API throttling)?
  3. Mitigation: How do you approach restoring service quickly while avoiding the destruction of key diagnostic data needed for later post-mortems?
  4. Resolution: What explicit signals and verification criteria must be met before officially concluding the incident?

Assume the system runs across multiple Kubernetes clusters using distributed tracing (e.g., OpenTelemetry/Jaeger), structured log collectors, and standard metric monitoring (e.g., Prometheus/Grafana).

Hints

Hint 1

Always start by checking for recent system modifications (deploys, configuration updates, or flag flips) and determining if the issue affects all endpoints or just a subset.

Hint 2

Use distributed tracing to isolate time spent inside the service versus time waiting on downstream calls or queueing.

Hint 3

Before taking destructive actions like restarting pods or rolling back code, isolate a single unhealthy instance to preserve memory dumps and traces.