Koskamo

Pipelining for round-trip efficiency

Document v1 · published by Koskamo editorial · updated 2026-10-04

Original source

Redis pipelining improves performance by issuing multiple commands without waiting for the response to each one, supported by most Redis clients. Redis uses a TCP Request/Response protocol, so every command normally costs a round-trip time (RTT): with a 250-millisecond RTT, even a server able to process 100k requests per second tops out at four requests per second without pipelining. Pipelining sends many commands and reads the replies in a single step — three pipelined PING commands over netcat pay the RTT cost once, not three times. The gain is not just RTT: socket I/O syscalls and the user-land to kernel-land context switch dominate per-command cost, and pipelining reads many commands with a single read() and delivers replies with a single write(), so queries per second rise almost linearly with longer pipelines before reaching about 10 times the baseline. Because the server must queue the replies in memory while a pipeline streams in, send large workloads in batches — for instance 10k commands at a time, reading the replies between batches — keeping speed nearly the same while bounding the memory used for queued replies. Scope: Redis. Reviewed October 4, 2026.

Source and provenance

Original source
redis.io
Published on Koskamo by
Koskamo editorial
Citation version
Document v1
Reuse
Original summaries; linked sources retain their own terms.

The original source supplies the underlying information. Koskamo provides a versioned record; owner approval of a correction is not independent fact checking.