devops5 min read

Analyzing round trip query latency

  • Datadog
  • PgBouncer

AI Summary

This article explains how to distinguish between database execution time and total round-trip latency by correlating APM traces with database-side metrics. It highlights that latency often originates in infrastructure components like connection pools, proxies, or load balancers rather than the database engine itself.

Key Takeaways

  • Round-trip latency includes network hops, proxies, and connection pools.
  • Database-side metrics (e.g., pg_stat_statements) only measure execution time, excluding transport overhead.
  • Comparing APM round-trip data against database execution metrics allows for precise bottleneck identification.

Why it matters

Engineers often waste time optimizing database queries when the bottleneck is actually in the network or middleware. Understanding how to decompose latency prevents misdirected troubleshooting efforts.

Conversation0

What would you add from your experience?

Checking your session…

Every good conversation starts with one perspective.