Thresholds and Rate Limits
Group thresholds protect your databases from queries that run too long or are called too often. They are configured per group.
Slow-query threshold
The slow-query threshold is a duration (in seconds). When a query takes longer than this to run, Kvery flags it as slow in the logs so you can spot and optimise problem queries. The default threshold is 30 seconds.
Use this to surface queries that need an index, a LIMIT, or a rewrite — before
they affect your production database.
Rate limit
The rate limit caps how many times queries in the group can be executed within a time window. This is especially important for queries published as a public API, where an endpoint could otherwise be called far more often than intended.
You configure:
- The maximum number of requests allowed.
- The window over which that maximum applies.
When the limit is reached, further requests are rejected until the window resets. By default the rate limit is off (no cap); set it explicitly to enforce one.
Choosing good values
- Start the slow-query threshold near your acceptable response time, then lower it as you optimise.
- Set a rate limit on any group that exposes public API endpoints, sized to your expected legitimate traffic plus headroom.
- Review the logs regularly to see which queries trip the slow-query threshold most often.