Pipelining აგზავნის მრავალ Redis ბრძანებას ერთ ქსელის რაუნდ-ტრიპში, იმის ნაცვლად, რომ დაელოდოთ თითოეული ბრძანების პასუხს შემდეგი ბრძანების აგზავნამდე. იგი მკვეთრად აუმჯობესებს throughput-ს მრავალი ბრძანების გაცემისას, რადგან ქსელის latency — და არა Redis თავად — ხშირად ხდება병목.
ის პრობლემა: round-trip latency
Normally each command is a request→reply round-trip:
send GET → wait for reply → send GET → wait for reply → ... (N × network latency)
→ Redis processes each command in microseconds, but each round-trip adds network
latency (e.g. 0.5ms). For 1000 commands, that's ~500ms JUST in waiting!
Pipelining: batch-ის ბრძანებები
pipeline = redis.();
( id userIds) pipeline.();
results = pipeline.();
