HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Redis is based on a client - server model and a request / response protocol TCP services. This means that a request will typically follow these steps:
Redis pipeline technology can not respond at the time of the server, the client can continue to send a request to the server, and eventually all at once to read the response of the server.
See redis pipeline, just you need to start redis instance and enter the following command:
$(echo -en "PING\r\n SET w3resourcekey redis\r\nGET w3resourcekey\r\nINCR visitor\r\nINCR visitor\r\nINCR visitor\r\n"; sleep 10) | nc localhost 6379 +PONG +OK redis :1 :2 :3
By using the above example wePING command redis service is available, then we have set up w3resourcekey value redis, and then we get the value w3resourcekey and make visitor increment 3 times.
In the returned results, we can see these commands at once submitted to redis service, and ultimately all at once to read the response of the server
The most significant advantage of technology to improve pipeline performance redis service.
In the following test, we will use the Redis Ruby client that supports pipeline technical characteristics, the test pipe technology to enhance the effect of 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 the LAN in Mac OS X system to perform the above data indicate that this simple script, open the pipeline operation, the round-trip delay has been improved quite low.
without pipelining 1.185238 seconds with pipelining 0.250783 seconds
As you can see, open the pipeline, we speed efficiency by 5 times.