← Back to Labs

Redis Write Path Lab

Follow one SET command from socket readiness through RESP parsing, the keyspace dictionary, TTL indexing, AOF buffering, replication, and BGSAVE copy-on-write pressure.

Client Socketquery bufferEvent Loopepoll ready setRESP Parserargv buildKeyspace Dictmain hash tableExpires DictTTL indexAOF Bufferappend historyRepl BacklogPSYNC bytesBGSAVE ChildRDB snapshotI/OThe kernel wakes one ready clientSET cart:142 {"sku":"A12","qty":2} EX 60
Step 1 / 7The kernel wakes one ready client

Redis is not polling every client in a loop. The kernel tells Redis which socket is readable, so the server wakes only for work that is actually ready.

The readable socket moves from idle state into the ready list, and the main thread starts draining bytes into the client query buffer.

Current trace: client query buffer: 54 bytes

logical keys
0
ttl index entries
0
aof buffered bytes
0
replication offset
0
bgsave child
idle
copy-on-write
0 MiB

Arrow keys to navigate · R to reset

Tap dots to jump to any step

Read the full article →Take the quiz →