How to judge whether redis is slowing down

Time:2021-7-16

As an in memory database, redis is fast,So how to judge whether redis is slowing down? What is the standard of slowing downBecause the configuration environment of the machine is different, we can’t simply compare the response time.

Redis provides a tool to detect the performance baseline of redis. If it exceeds a certain range of the baseline, it can be considered that redis is slowing down.

This paper introduces the above problems.

Determine redis performance baseline

The redis cli command provides the — intrinsic latency option, which can be used to count the data during the testMaximum delayThis delay can be used as the performance baseline of redis.

command

src/redis-cli --intrinsic-latency 120

120 represents run 120 seconds. Generally, running 120 seconds is enough to detect the maximum delay

demonstration

How to judge whether redis is slowing down

The maximum delay of the test is 2.1414 MS, which can be used as the baseline.

Judge if it slows down

In general,When the response of redis is more than twice the baselineIt can be said that redis is slowing down.

For example,

  1. The response is 2.5 ms, not slow
  2. Five milliseconds, more than twice, slower.