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
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/ MapReduce Service/ User Guide (Ankara Region)/ Troubleshooting/ Using HBase/ High CPU Usage Caused by Zero-Loaded RegionServer

High CPU Usage Caused by Zero-Loaded RegionServer

Updated on 2024-11-29 GMT+08:00

Symptom

The CPU usage of RegionServer is high, but there is no service running on RegionServer.

Cause Analysis

  1. Run the top command to obtain the CPU usage of RegionServer processes and check the IDs of processes with high CPU usage.
  2. Obtain the CPU usage of threads under these processes based on the RegionServer process IDs.

    Run the top -H -p <PID> (replace it with the actual RegionServer process ID). As shown in the following figure, the CPU usage of some threads reaches 80%.

     PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
     75706 omm       20   0 6879444   1.0g  25612 S  90.4  1.6   0:00.00 java
     75716 omm       20   0 6879444   1.0g  25612 S  90.4  1.6   0:04.74 java
     75720 omm       20   0 6879444   1.0g  25612 S  88.6  1.6   0:01.93 java
     75721 omm       20   0 6879444   1.0g  25612 S  86.8  1.6   0:01.99 java
     75722 omm       20   0 6879444   1.0g  25612 S  86.8  1.6   0:01.94 java
     75723 omm       20   0 6879444   1.0g  25612 S  86.8  1.6   0:01.96 java
     75724 omm       20   0 6879444   1.0g  25612 S  86.8  1.6   0:01.97 java
     75725 omm       20   0 6879444   1.0g  25612 S  81.5  1.6   0:02.06 java
     75726 omm       20   0 6879444   1.0g  25612 S  79.7  1.6   0:02.01 java
     75727 omm       20   0 6879444   1.0g  25612 S  79.7  1.6   0:01.95 java
     75728 omm       20   0 6879444   1.0g  25612 S  78.0  1.6   0:01.99 java
  3. Obtain the thread stack information based on the ID of the RegionServer process.

    jstack 12345 >allstack.txt (Replace it with the actual RegionServer process ID.)

  4. Convert the thread ID into the hexadecimal format:

    printf "%x\n" 30648

    In the command output, the TID is 77b8.

  5. Search the thread stack based on the hexadecimal TID. It is found that the compaction operation is performed.

  6. Perform the same operations on other threads. It is found that the threads are compaction threads.

Solution

This is a normal phenomenon.

The threads that consume a large number of CPU resources are compaction threads. Some threads invoke the Snappy compression algorithm, and some threads invoke HDFS data writing and reading. Each region has massive sets of data and numerous data files and uses the Snappy compression algorithm. For this reason, the compaction operations consume a large number of CPU resources.

Fault Locating Methods

  1. Run the top command to check the process with high CPU usage.
  2. Check the threads with high CPU usage in the process.

    Run the top -H -p <PID> command to print CPU usage of threads under the process.

    Obtain the thread with the highest CPU usage from the query result. You can also obtain the thread by running the following command:

    Or run the ps -mp <PID> -o THREAD,tid,time | sort -rn command.

    View the command output to obtain the ID of the thread with the highest CPU usage.

  3. Obtain the stack of the faulty thread.

    The jstack tool is the most effective and reliable tool for locating Java problems.

    You can obtain the jstack tool from the java/bin directory.

    jstack <PID> > allstack.txt

    Obtain the process stack and output it to a local file.

  4. Convert the thread ID into the hexadecimal format:

    printf "%x\n" <PID>

    The process ID in the command output is the TID.

  5. Run the following command to obtain the TID and output it to a local file:

    jstack <PID> | grep <TID> > Onestack.txt

    If you want to view the TID in the CLI only, run the following command:

    jstack <PID> | grep <TID> -A 30

    -A 30 indicates that 30 lines are displayed.

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