February 2018
Intermediate to advanced
382 pages
11h 33m
English
The --pipe option in redis-cli will send all the commands from stdin in one shot, avoiding the cost of RTT significantly.
Furthermore, the commands can be in the format of a raw RESP protocol by which the client communicates with the Redis Server. For the preceding example, the following operation can do the same job:
$ cat datapipe.txt*3\r\n$3\r\nSET\r\n$5\r\nmykey\r\n$7\r\nmyvalue\r\n*4\r\n$4\r\nSADD\r\n$5\r\nmyset\r\n$6\r\nvalue1\r\n$6\r\nvalue2\r\n*2\r\n$3\r\nGET\r\n$5\r\nmykey\r\n*2\r\n$5\r\nSCARD\r\n$5\r\nmyset\r\n$ echo -e "$(cat datapipe.txt)" | bin/redis-cli --pipe All data transferred. Waiting for the last reply... Last reply received from server. errors: 0, replies: 4
Also, with the --pipe option of redis-cli
Read now
Unlock full access