Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Distributed Cache Service/ User Guide/ Diagnosing and Analyzing an Instance/ Querying Big Keys and Hot Keys in a DCS Redis Instance

Querying Big Keys and Hot Keys in a DCS Redis Instance

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

Big keys and hot keys are common issues. This section describes the big key and hot key analysis function on the DCS console. This function monitors the key that occupies most space of a Redis instance, or that is most frequently accessed from the storage data.

  • There are two types of big keys:
    • The key value occupies much storage space. If the size of a single String key exceeds 10 KB, or if the size of all elements of a key combined exceeds 50 MB, the key is defined as a big key.
    • The key contains many elements. If the number of elements in a key exceeds 5000, the key is defined as a big key.
  • A hot key is most frequently accessed, or consumes significant resources. For example:
    • In a cluster instance, a shard processes 10,000 requests per second, among which 3000 are performed on the same key.
    • In a cluster instance, a shard uses a total of 100 Mbits/s inbound and outbound bandwidth, among which 80 Mbits/s is used by the HGETALL operation on a Hash key.

Notes and Constraints

Notes on big key analysis:

  • During big key analysis, all keys will be traversed. The larger the number of keys, the longer the analysis takes.
  • Perform big key analysis during off-peak hours and avoid automatic backup periods.
  • For a master/standby, read/write splitting, or cluster instance, the big key analysis is performed on the standby node, so the impact on the instance is minor. For a single-node instance, the big key analysis is performed on the only node of the instance and will reduce the instance access performance.
  • A maximum of 100 analysis records are retained for each instance. When this limit is reached, the oldest records will be deleted to make room for new records. You can also manually delete records you no longer need.

Notes on hot key analysis:

  • Hot keys can be analyzed only for DCS Redis 4.0 and later instances.
  • The maxmemory-policy parameter of the instance must be set to allkeys-lfu or volatile-lfu.
  • During hot key analysis, all keys will be traversed. The larger the number of keys, the longer the analysis takes.
  • Perform hot key analysis shortly after peak hours to ensure the accuracy of the analysis results.
  • The hot key analysis is performed on the master node of each instance and will reduce the instance access performance.
  • A maximum of 100 hot key analysis records are retained for each instance. When this limit is reached, the oldest records will be deleted to make room for new records. You can also manually delete records you no longer need.
NOTE:

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

Querying Big Keys

  1. Log in to the DCS console.
  2. Click in the upper left corner of the management console and select the region where your instance is located.
  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, you can manually start a big key analysis or schedule a daily automatic analysis.
  7. After an analysis task completes, click View to view the analysis results of different data types.

    You can also click Download or Delete in the Operation column to download or delete the analysis result.

    NOTE:

    The big key analysis result shows records of the top 100 (20 for Strings and 80 for Lists/Sets/Zsets/Hashes) data size.

    Figure 1 Viewing the results of big key analysis (for Strings)
    Figure 2 Viewing the results of big key analysis (for Lists/Sets/Zsets/Hashes)
    Table 1 Results of big key analysis

    Parameter

    Description

    Key

    The key name in a big key analysis result.

    Type

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

    Size

    The value size of a key, in Bytes.

    Quantity

    Number of elements in a key. This parameter is displayed only for list, set, zset, or hash type. Unit: counts

    Database

    Database where the key is located.

Querying Hot Keys

  1. Log in to the DCS console.
  2. Click in the upper left corner of the management console and select the region where your instance is located.
  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, you can manually start a hot key analysis or schedule a daily automatic analysis.

    NOTE:

    If the instance was created before July 2020, the default value of the maxmemory-policy parameter is noeviction. If the instance was created in or after July 2020, the default value of the maxmemory-policy parameter is volatile-lru. To perform hot key analysis, set this parameter to allkeys-lfu or volatile-lfu on the Instance Configuration > Parameters page. For details about allkeys-lfu and volatile-lfu, see What Is the Default Data Eviction Policy?

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

    You can also click Download or Delete in the Operation column to download or delete the analysis result.

    NOTE:

    The hot key analysis result shows the most 100 frequently accessed keys within the specified period.

    Figure 3 Viewing the results of hot key analysis
    Table 2 Results of hot key analysis

    Parameter

    Description

    Key

    The key name in a hot key analysis result.

    Type

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

    Size

    The value size of a key, in Bytes.

    FREQ

    Reflects the access frequency of a key within a specific period of time (usually 1 minute).

    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 key is located.

    NOTE:

    This parameter is displayed only for cluster instances.

    Database

    Database where a key is located.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback