Redis Engine CPU Investigation

Pierre RAFFA
3 min readMar 23, 2020

The investigation about Redis covers 2 aspects:

  • Identify if the vertical scaling makes sense to make the Engine CPU Utilisation lower
  • Identify how the Engine CPU Utilisation increases depending on the workload.

1. Engine CPU Utilisation Performance on Vertical Scale

The purpose of this investigation is to understand if there are some benefits when vertical scaling for the Engine CPU Utilisation as Redis is single-threaded.
To do so, the exact same workload is sent to different Redis instance (4 to 16 cores).
The workload is 1000 concurrent requests x 36000 times running in one ECS task. Each request fetches some data.
In other words, 1000 requests are sent at the same time to fetch a key. When all of them processed, another batch is sent and so on… 36000 times

Redis 4cores

Execution time : 381.196s
Number of Requests : 36 000 000
Requests/sec : 94439
Engine CPU Utilisation: ~80%

Redis 8cores

Execution time : 365.907s
Number of Requests : 36 000 000
Requests/sec : 98 385
Engine CPU Utilisation: ~80%

Redis 16cores

Execution time : 378.476s
Number of Requests : 36 000 000
Requests/sec : 95118.31661716991
Engine CPU Utilisation: ~80%

Conclusion:

This metrics show clearly the number of cores present in Redis instances does not have an impact on Engine CPU Utilisation.
These also show the number of requests processed per second is the same whatever the number of cores.
Finally, the vertical scaling does not have much sense if you want to reduce the Engine CPU Utilisation. A reason for the vertical scaling is to increase the Redis Memory.

2. Engine CPU Utilisation against different workloads

The purpose of this test is to understand how the Engine CPU Utilisation increases with the workload.
For all the tests below, the Redis instance used in this test is all the time the same and has 4cores.
Some ECS tasks will be running to hit Redis and each of them will create 40000 concurrents req x 30 times.

Workload: 1 ECS task

Execution time : 254.69s
Number of Requests : 1 200 000
Requests/sec : 4711.610192783383
CPU Engine Utilisation: ~15%

Workload: 2 ECS tasks

Execution time : 285.807s
Number of Requests : 2 400 000
Requests/sec : ~8400
CPU Engine Utilisation: ~23%

Workload: 4ECS tasks

Execution time : 363.214s
Number of Requests : 4 800 000
Requests/sec : ~13240
CPU Engine Utilisation: ~37%

Workload: 8ECS tasks

Execution time : 584.317s
Number of Requests : 9 600 000
Requests/sec : ~16 400
CPU Engine Utilisation: ~43%

Conclusion:

Based on the metrics above, we can see the Engine CPU Utilisation increases with the workload.
The chart below compares the Engine CPU Utilisation against the requests per second.
And it shows clearly Engine CPU Utilisation increases linearly with the number of requests per second.

--

--