当前位置:网站首页>Redis pipeline technology speed and efficiency increased by 5 times
Redis pipeline technology speed and efficiency increased by 5 times
2022-06-24 04:54:00 【User 1685462】
Redis It's a client based - Server model and request / In response to the protocol TCP service . This means that normally a request follows these steps :
- The client sends a query request to the server , And monitor Socket return , Usually in blocking mode , Waiting for the server to respond .
- The server handles commands , And return the result to the client .
Redis Pipeline technology
Redis Pipeline technology can be used when the server is not responding , The client can continue to send requests to the server , And finally read all the server's responses at once .
example
see redis The Conduit , Just start redis Instance and enter the following command :
$(echo -en "PING\r\n SET runoobkey redis\r\nGET runoobkey\r\nINCR visitor\r\nINCR visitor\r\nINCR visitor\r\n"; sleep 10) | nc localhost 6379 +PONG +OK redis :1 :2 :3
In the above example, we use PING Command view redis Is the service available , And then we set up runoobkey The value of is redis, Then we get runoobkey And make visitor Self increasing 3 Time .
In the returned results, we can see that these commands are directed to redis Service submission , And finally read all the server's responses at once
Advantages of Pipeline Technology
The most significant advantage of pipeline technology is the improvement of redis Service performance .
Some test data
In the following test , We will use Redis Of Ruby client , Support pipeline technical characteristics , Test the effect of pipeline technology on speed .
require 'rubygems'
require 'redis'
def bench(descr)
start = Time.now
yield
puts "#{descr} #{Time.now-start} seconds"
end
def without_pipelining
r = Redis.new
10000.times {
r.ping
}
end
def with_pipelining
r = Redis.new
r.pipelined {
10000.times {
r.ping
}
}
end
bench("without pipelining") {
without_pipelining
}
bench("with pipelining") {
with_pipelining
}From... In the LAN Mac OS X The data of executing the above simple script on the system shows that , After opening the pipeline operation , Round trip delay has been improved to a fairly low level .
without pipelining 1.185238 seconds with pipelining 0.250783 seconds
As you can see , After opening the pipe , Our speed and efficiency have improved 5 times .
边栏推荐
- oracle数据库提示无操作权限的问题
- How to open the port of ECS what are the precautions for using ECS
- Brief introduction: how much do you know about supply chain attacks
- Spirit breath development log (15)
- 大一下学期期末总结(补充知识漏洞)
- Confluence data center version is nearing its lifecycle
- 少儿编程课程改革后的培养方式
- Web penetration test - 5. Brute force cracking vulnerability - (5) SMB password cracking
- Locating memory leaks with poolmon
- Facebook内部通告:将重新整合即时通讯功能
猜你喜欢

解析90后创客教育的主观积极性

SAP MTS/ATO/MTO/ETO专题之七:ATO模式1 M+M模式策略用82(6892)

Zhang Xiaodan, chief architect of Alibaba cloud hybrid cloud: evolution and development of government enterprise hybrid cloud technology architecture

梯度下降法介绍-黑马程序员机器学习讲义

SAP MTS/ATO/MTO/ETO专题之十:ETO模式 Q+空模式 未估价库存 策略自定义

MySQL - SQL execution process

TCPIP协议详解

Training methods after the reform of children's programming course

『应急响应实践』LogParser日志分析实践

Detailed explanation of tcpip protocol
随机推荐
Specificity and correlation of Worthington deoxyribonuclease I
Introduction to vulnerability priority technology (VPT)
What if the ECS forgets its password? How can I retrieve my forgotten password?
提pr,push 的时候网络超时配置方法
How to add a domain name to ECS? What are the advantages of ECS?
Verifying data models in golang
Recognize workplus again, not only im but also enterprise mobile application management expert
How to control CDN traffic gracefully in cloud development?
数据库解答建标,按要求回答
How to enlarge the ECS page? How to select ECS instance specifications?
oracle数据库提示无操作权限的问题
ribbon
解析90后创客教育的主观积极性
Black horse programmer machine learning handout: preliminary use of linear regression API
Analyze the actual user groups and demand positioning of distributed database products from the market and demand
Real time monitoring: system and application level real-time monitoring based on flow computing Oceanus (Flink)
『渗透基础』Cobalt Strike基础使用入门_Cobalt Strike联动msfconsole
Bi-sql basic cognition
Database answers build standard, answer as required
Jimureport building block report - what problems does the layout design solve?