Command Palette

Search for a command to run...

Hectal
Phase 13Advanced14 of 17 in Redis

Performance & Observability

Hot keys, big keys, command complexity, connection and network costs, the metrics that matter, SLOWLOG and LATENCY, and a debugging tree for when Redis goes from 2 ms to 2 s.

Redis performance problems almost always come from a few causes: one key getting too much traffic, one key being too big, O(N) commands, too many round trips, persistence forks, memory pressure, or the network. This phase teaches you to find each one quickly with evidence.

It ends with the production incident interviewers love: latency jumps a thousandfold, and you walk through a structured diagnosis instead of guessing.

0/5 · 0%
5 topics ~47 min 9 code blocks & diagrams
Start with the first topic
1
13.1

Hot Keys: One Key, Millions of Requests

A hot key concentrates traffic on one shard's single thread and network link, so adding shards doesn't help. Find hot keys with LFU-based tools, then spread or absorb the load: local caching, read replicas, key replication with random suffixes, sharded counters, and request coalescing.

10 min 1 diagram 1 code practice

2
13.2

Big Keys: Finding and Fixing Them Safely

A big key (a huge string or a collection with millions of elements) makes every whole-key operation slow, blocks the server, inflates replication and migration, and can stall Redis for seconds when deleted. Find them with --bigkeys/--memkeys, read them with SCAN-family commands, delete them with UNLINK, and split them for good.

10 min 2 code practice

3
13.3

Performance Engineering: Complexity, Round Trips, Connections

Redis performance comes down to command complexity (avoid unbounded O(N)), round trips (batch, pipeline, script), payload size, connection management, CPU saturation of the main thread, and memory pressure. SCAN-family commands replace dangerous full-collection reads.

8 min 1 code practice

4
13.4

Monitoring Redis: INFO, SLOWLOG, LATENCY, and Alerts

Monitor Redis with a small set of metrics that map to real failures: memory and evictions, hit ratio, ops and latency, clients and blocked clients, persistence status, replication links and lag, and cluster state. Collect them with an exporter, graph them, and alert on symptoms users feel.

9 min 2 code practice

5
13.5

Debugging a Latency Incident: 2 ms to 2 s

When Redis latency jumps, work through a structured tree: is it the client or the server; network; CPU; slow commands or big keys; hot keys; persistence forks and fsync; memory pressure, swapping or eviction; replication; connection storms; cluster migrations. Each branch has a specific piece of evidence.

10 min 1 diagram 1 code practice