Why does query latency fluctuate so much

Why does query latency fluctuate so much? It's normally around 60 ms but sometimes down to 10 ms for short periods.
5 Replies
Isak
Isak4w ago
kysely:query: duration: 52.0ms
kysely:query: duration: 8.0ms
kysely:query: duration: 58.0ms
kysely:query: duration: 52.0ms
kysely:query: duration: 8.0ms
kysely:query: duration: 58.0ms
thomasgauvin
thomasgauvin4w ago
What does your data access pattern look like? might that be the difference between a cached query and an uncached query?
Isak
Isak4w ago
Cache is disabled and mostly simple select all queries on small tables. What is the expected latency for a database hosted on neon with cache disabled? Tested again now as it started at around 15ms but then suddenly went up to 60ms and then back down. It's not consistent.
thomasgauvin
thomasgauvin4w ago
These might be network level routing fluctuations, which region is the request being made from and which region is your database located in?
Isak
Isak4w ago
The request is from EU and the database is also hosted there. It's just noticeable when the latency is higher versus lower.