Database / ValKey Interview questions
How do you troubleshoot high latency in a Valkey deployment?
Start with LATENCY DOCTOR and LATENCY HISTORY for a summary of recent latency spikes, then check SLOWLOG GET to see which specific commands exceeded the configured slow-log threshold.
Look for expensive patterns such as KEYS on a large keyspace, unbounded SORT calls on huge collections, or a single very large key that turns an otherwise O(1) command into an O(N) one.
Also check whether spikes line up with BGSAVE or AOF rewrite events, since forking a child process for a large dataset has a real, if usually brief, cost, and rule out OS-level causes like CPU saturation, swapping, or memory eviction thrashing.
More Related questions...