In the past period of time, various problems have occurred in our online redis. I would like to add some monitoring indicators for redis, to help us better monitor the status of redis. This is my initial idea, I'm not sure if anyone in the community needs it.

  1. the number of clients that are closed abnormally The number of abnormal shutdowns in the client: the abnormality here is not a problem at the tcp level, but an abnormality at the redis application layer: there is still unfinished data in redis querybuf and replybuf when client is closed. This is usually caused by timeout. By monitoring these the number of clients that are closed without completing the request, we can approximately observe the success rate of the user's requests.

  2. Count the number of passively expired keys during keys expiration. Redis currently only have statistics on the number of expired keys, but we want to know the number of actively expired keys in serverCron and the number of passively expired keys when users request these expired keys. This is usually related to performance: if there is only active expiration in serverCron, the delay will sometimes become very large

  3. The average number of requets in pipeline like qps, shows the changes in the number of average requests in pipeline in the recent period, which will also affect the user's performance and latency

  4. The peak qps in recent period Due to monitoring cost considerations, we cannot collect qps frequently, but this value is very important and changes quickly. We want to record the maximum value of qps between this info command and the last info command. A interesting case: We always collect statistics at 0\10\20... seconds every minute, but the user always has burst traffic at the 5th and 35th second.

  5. slowlog just a small repeat, we all need the features discussed by these PRs #12192 #12492