Updated on 2024-10-08 GMT+08:00

Big Key Diagnosis

Functions

A key that contains a large volume of data is considered a big key. GeminiDB Redis API can diagnose big keys, allowing you to collect statistics on big keys in the current instance.

GeminiDB Redis API uses shared storage, so big keys do not cause data skew or out of memory (OOM) issues on shards. Access to big keys is common when you are using Redis databases. Big key diagnosis obtains analysis results from the background, minimizing the impact on services.

Viewing the Diagnostic Information of Big Keys

  1. Log in to the GeminiDB console.
  2. In the service list, choose Databases > GeminiDB Redis API.
  3. On the Instances page, click the name of the target instance to go to the Basic Information page.
  4. In the navigation pane on the left, choose Diagnosis Analysis.
  5. Choose Big Key Diagnosis and select the target types.

    Figure 1 Big key diagnosis

  6. View big key parameters by referring to Table 1.

    Table 1 Big key parameters

    Parameter

    Description

    Type

    Type of a big key.

    • string
    • hash
    • zset
    • set
    • exhash
    • list
    • stream

    Big Key Name

    Name of a big key.

    Length

    Length of the value.

    DB

    Database where a big key is located.

Setting Parameters for Big Key Diagnosis

The value size of a key determines whether the key is a string key. The number of members in the key determines whether the key is a hash, list, zset, set, or stream key.

There are two parameters involved:

  • bigkeys-string-threshold: If the value size of a string key is greater than the value of this parameter, the key is determined as a big key. The unit is byte. The default value is 102400 (1 MB).
  • bigkeys-composite-threshold: If the number of elements in a hash, list, zset, set, or stream key is greater than the value of this parameter, the key is identified as a big key. The default value is 10240.
  • Figure 2 Parameters for big key diagnosis

Do not set these two parameters to small values. Otherwise, too many invalid results are generated and occupy the network bandwidth, slowing down data access.

For details about how to modify parameters for big key diagnosis, see Modifying Parameters of an Instance.