Database Latency Test

Browsers can't speak raw TCP to a database — but you can measure the round-trip to a DB health/HTTP proxy endpoint, and model how query latency stacks up against your request budget.

🔒 Runs entirely in your browser · nothing is uploaded or stored
Query budget calculator
DB time / request
Max req/sec (1 conn)

📍 Reference RTTs

  • Same host (unix socket): <0.5 ms
  • Same datacenter/VPC: 0.3–2 ms
  • Cross-region: 30–200 ms
  • Redis cache hit: <1 ms

🧰 Kill latency

  • Co-locate app & DB in one region
  • Connection pooling (PgBouncer)
  • Batch N+1 queries
  • Cache hot reads in Redis

Frequently Asked Questions

Can this connect directly to MySQL or Postgres?

No — browsers can't open raw TCP database connections, and exposing a DB to the public internet is unsafe. Point it at an HTTP health endpoint or API in front of your DB instead.

Why is the measured RTT higher than my real DB latency?

The browser probe includes DNS, TLS and the full HTTP round-trip. Your app-to-DB latency inside the same region is typically far lower — use the calculator with your real numbers.