Reputation: 153
I was wondering, when does pipelining become more efficient? E.g. if I have to query the server once, a pipeline would be less efficient that just using the redis instance.
If I have to query the server twice, e.g. check something exists, if it does, grab it, is pipeline more efficient or is using the redis instance?
If I have to query something three times.. etc.
When does pipelining become more efficient than using the redis instance?~
Thank you
Upvotes: 0
Views: 1237
Reputation: 1087
If you only operation once , it's the same .
The pipelining like batch process mechanism . If you have three commands to execute at the normal way , the client need send three tcp packets and receive three tcp packets (every command need send one and receive one ) ; but when use pipelining , the client package 3 command to server , just send one tcp packet and receive one .
You can see the official document : Using pipelining to speedup Redis queries
Upvotes: 2