Prompt
Redis latency spikes during traffic bursts
Latest observation
Oct 15, 2026
OpenAI APIWeb search: off
Redis latency spikes during traffic bursts are usually caused by one or more of these:
Common causes
- CPU saturation: Redis is single-threaded for command execution, so bursts can queue requests.
- Slow commands:
KEYS, largeLRANGE, bigSMEMBERS,SORT, Lua scripts, etc. - Large payloads: big values increase network and serialization time.
- Memory pressure / swapping: if the OS swaps Redis, latency jumps badly.
- Fork-related pauses:
BGSAVE,BGREWRITEAOF, or replication can cause copy-on-write overhead. - Connection storms: many clients reconnecting at once.
- Persistence overhead: AOF fsync settings can add spikes.
- Evictions / expiration cycles: too many key expirations or eviction activity during bursts.
- Network bottlenecks: NIC saturation, packet loss, or cross-zone latency.
What to check first
- Redis slowlog
SLOWLOG GET
- Latency doctor
redis-cli --latencyredis-cli LATENCY DOCTOR
- Instantaneous ops and CPU
INFO commandstatsINFO statsINFO cpu
- Blocked / slow clients
CLIENT LIST
- Persistence / fork events
INFO persistence
- OS metrics
- CPU, memory, swap, disk I/O, network, context switches
Typical fixes
- Replace expensive commands with more efficient patterns.
- Break large values into smaller ones.
- Add client-side backpressure and connection pooling.
- Use pipelining to reduce round trips.
- Avoid big bursts with rate limiting or queueing.
- Disable or tune persistence if acceptable:
appendfsync everysecinstead ofalways- avoid unnecessary
BGSAVE
- Ensure Redis has:
- no swap
- enough RAM
- CPU headroom
- Scale out:
- read replicas for read-heavy traffic
- sharding/cluster for write-heavy or high-QPS workloads
- If using Lua, keep scripts short and deterministic.
Quick diagnostic command set
redis-cli LATENCY DOCTOR
redis-cli SLOWLOG GET 20
redis-cli INFO cpu
redis-cli INFO stats
redis-cli INFO persistence
redis-cli CLIENT LIST | head
If you want, I can help you diagnose your specific spike by looking at:
LATENCY DOCTORSLOWLOG GETINFO persistenceINFO stats- your Redis version and deployment setup
Brands