Home > Back-end >  What are the advantages of the 2021-01-30: in redis, Pipeline?
What are the advantages of the 2021-01-30: in redis, Pipeline?

Time:01-31

What are the advantages of the 2021-01-30: in redis, Pipeline? # # f greatly architects a daily topic

CodePudding user response:

Pipeline are the benefits of reduced the loss in the network transmission time, for example, you need to perform 100 redis command, under the condition of the pipeline, you need the number of network transmission for 200 times, 100 times for sending commands to the redis server, 100 to return results from redis server), but if you use the pipeline, so, I can one will send to the redis server 100 commands, the network number is 1, the same receiving redis server returns the number of times is 1, a single from the number, pipeline than single command mode, reduce the 198 damage brought about by the network transmission time, continue to analyze, redis server performs commands are the single thread model, so follow 100 orders, whether pipeline mode, or a single way, time is consistent, so can conclude that the advantage of pipeline is to reduce network transmission time loss,
Suggest the building Lord give it a try, loop 100 times the get command, 1 100 the get command pipeline way, contrast is fairly obvious
  • Related