From the course: Advanced Redis

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Performance improvement with pipelining

Performance improvement with pipelining - Redis Tutorial

From the course: Advanced Redis

Performance improvement with pipelining

We've discussed that Redis pipelining is a technique that we use to improve performance by issuing multiple commands at once without waiting for the response to each individual command. Let's now prove that pipelining does indeed improve performance. Here in my current working directory, I have two different files that perform the same set of operations on my Redis database server. In one of the files, run_without_pipeline.py, I'm going to run those operations without using pipelining, but in the second file, run_with_pipeline, I'm going to run the operation as a batch using pipelined commands and we'll see what the difference is in round trip time. Let's first take a look at the Python program where we execute the commands without using a pipeline. I have a function defined here called run_ without_pipelining. Within that function on Line 6, I instantiate a connection to the Redis server on my local machine. I set a new value in my database called without_pipeline and initialize that…

Contents