Analyze and Improve End-to-End Request Latency
Context
A user request flows: Browser → CDN → Load Balancer → API Gateway → Microservices → Caches/Databases → Third‑party services → Response to Browser. You need to analyze and reduce end‑to‑end latency without harming reliability or throughput.
Assume modern browsers (Navigation/Resource/Long Tasks APIs), HTTP/2+, and backend microservices where you can add distributed tracing and metrics.
Tasks
-
Instrument both client and server to capture:
-
Client: TTFB, Total Blocking Time (TBT), network RTT, resource timing, and user-perceived completion.
-
Server: queueing time, service processing time, database query latency, cache hit/miss rates, and external dependency latency.
-
Attribute latency to frontend vs. backend components across the whole path.
-
Investigate p50/p95/p99 outliers and identify bottlenecks.
-
Propose changes or experiments to reduce latency without regressing error rate or throughput.
-
Define SLIs/SLOs, dashboards, and alerts for ongoing monitoring.