Analyzing Big Keys and Hot Keys

By performing big key analysis and hot key analysis, you will have a picture of keys that occupy a large space and keys that are the most frequently accessed.

Notes on big key analysis:

Notes on hot key analysis:

Perform big key and hot key analysis during off-peak hours to avoid 100% CPU usage.

Big Key Analysis Procedure

  1. Log in to the DCS console.
  2. Click in the upper left corner and select a region and a project.
  3. In the navigation pane, choose Cache Manager.
  4. Click the name of a DCS Redis instance.
  5. Choose Analysis and Diagnosis > Cache Analysis.
  6. On the Big Key Analysis tab page, manually perform big key analysis or schedule daily automatic analysis.
  7. After an analysis task completes, click View to view the analysis results.

    You can view the analysis results of different data types.

    A maximum of 20 big key analysis records are retained for Strings and 80 are retained for Lists, Sets, Zsets, and Hashes.

    Table 1 Results of big key analysis

    Parameter

    Description

    Key

    Name of a big key.

    Type

    Type of a big key, which can be string, list, set, zset, or hash.

    Size

    Size or number of elements of a big key.

    Shard

    Shard where the big key of the cluster instance is located.

    Database

    Database where a big key is located.

Hot Key Analysis Procedure

  1. Log in to the DCS console.
  2. Click in the upper left corner and select a region and a project.
  3. In the navigation pane, choose Cache Manager.
  4. Click the name of a DCS Redis instance.
  5. Choose Analysis and Diagnosis > Cache Analysis.
  6. On the Hot Key Analysis tab page, manually perform hot key analysis or schedule daily automatic analysis.

    If hot key analysis cannot be performed, set maxmemory-policy to allkeys-lfu or volatile-lfu. If this parameter has already been set to allkeys-lfu or volatile-lfu, perform hot key analysis right away.

  7. After an analysis task completes, click View to view the analysis results.

    The hot key analysis results are displayed.

    The console displays a maximum of 100 hot key analysis records for each instance.

    Table 2 Results of hot key analysis

    Parameter

    Description

    Key

    Name of a hot key.

    Type

    Type of a hot key, which can be string, hash, list, set, or sorted set.

    Size

    Size of the hot key value.

    FREQ

    Reflects the access frequency of a key within a specific period of time.

    FREQ is the logarithmic access frequency counter. The maximum value of FREQ is 255, which indicates 1 million access requests. After FREQ reaches 255, it will no longer increment even if access requests continue to increase. FREQ will decrement by 1 for every minute during which the key is not accessed.

    Shard

    Shard where the hot key of the cluster instance is located.

    DataBase

    Database where a hot key is located.