当前位置:网站首页>Redis learning notes pipeline
Redis learning notes pipeline
2022-06-23 09:11:00 【Love Guoba】
Redis The client execution of a command is divided into the following four processes
No matter how long the network delays , Packets can always reach the server from the client , And return data from the server to the client , Such from 1~4 The time required is called Round Trip Time(RTT, Round trip time )
Redis Batch operation commands are provided ( for example mget、mset etc. ), Save effectively RTT, But most commands do not support batch operations , It is very unwise to consume time on the network every time you request ,Pipeline( Assembly line ) The mechanism can improve the above problems , It can combine a group of Redis Command assembly , Through a RTT Transferred to the Redis, Will this group again Redis The execution of the command is returned to the client in order
The picture below is not used Pipeline The situation of , There will be as many requests as there are RTT, It will spend a lot of time on network transmission
Pipeline Execution speed is generally faster than item by item execution ; The greater the network delay between the client and the server ,Pipeline The more obvious the effect of , The figure below shows the use of pipeline Implementation
have access to Pipeline Simulate the effect of batch operation , But when using it, you should pay attention to the difference between it and the native batch command , It includes the following points :
- The native batch command is atomic ,Pipeline It's non atomic
- A native batch command is a command that corresponds to multiple key,Pipeline Supports multiple commands
- The native batch command is Redis The server supports the implementation of , and Pipeline It needs to be realized by both the server and the client
Pipeline Although easy to use , But every time Pipeline The number of assembly commands cannot be unlimited , Otherwise, one assembly Pipeline Too much data , On the one hand, it will increase the waiting time of the client , On the other hand, it will cause some network congestion , It's possible to put a Pipeline Split into several smaller Pipeline To complete .Pipeline Only one can be operated Redis example , But even in distributed Redis Scene , It can also be used as an important optimization method for batch operation
边栏推荐
- Structure binary tree from preorder and inorder traversal for leetcode topic analysis
- Isomorphic strings for leetcode topic resolution
- Utilisation du cookie du module de demande de noeud
- Redis学习笔记—数据类型:有序集合(zset)
- Basic process of code scanning login
- Fraction to recursing decimal
- Redis学习笔记—数据类型:集合(set)
- Map接口的注意事项
- 297. Serialize and Deserialize Binary Tree
- 进入小公司的初级程序员要如何自我提高?
猜你喜欢

Servlet-02 生命周期

js 用**遮罩身份证以及手机号的重要数据

学习SCI论文绘制技巧(E)
Redis学习笔记—数据类型:字符串(string)

力扣之滑动窗口《循序渐进》(209.长度最小的子数组、904. 水果成篮)

Flink错误--Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered “time“
![[cloud native | kubernetes] kubernetes principle and installation (II)](/img/db/dd93bbcac6d0404d44f67d2da12880.png)
[cloud native | kubernetes] kubernetes principle and installation (II)

General paging (1)
Redis学习笔记—持久化机制之AOF

Le rapport d'analyse de l'industrie chinoise des bases de données a été publié en juin. Le vent intelligent se lève, les colonnes se régénèrent
随机推荐
A method of realizing video call and interactive live broadcast in small programs
@Response
986. Interval List Intersections
1、 Software architecture evaluation
ARM处理器与51单片机程序编写的区别
线性表(LinkList)的链式表示和实现----线性结构
Jog运动模式
The results of CDN node and source station are inconsistent
Leetcode topic analysis group anagrams
JSP入门总结
MySQL fault case | mysqldump: couldn't execute 'select column_ NAME
Mysql 数据库入门总结
Custom tag - JSP tag Foundation
Structure binary tree from inorder and postorder traversal for leetcode topic analysis
[qnx hypervisor 2.2 user manual]6.1 using the QNX hypervisor system
多线程初学
自定义标签——jsp标签基础
【NanoPi2试用体验】裸机第一步
636. Exclusive Time of Functions
学习SCI论文绘制技巧(F)