Analyzer cpu-hogs
Name
cpu-hogs - cpu hogs of the system
This analyzer identifies processes consuming the most CPU resources on the system. It monitors CPU usage across all running processes and generates bar charts showing the top CPU consumers. The analyzer helps quickly pinpoint resource-intensive applications and diagnose system-wide performance degradation caused by CPU contention.
Resource Category
CPU.
Application Type & Technical Stack
- All
Command Line Syntax
The analyzer can be invoked directly on the command-line via the orxray
utility from the openresty-xray-cli software package.
Alternatively, the analyzer can also be invoked manually or automatically on the web console UI of OpenResty XRay (like on the Advanced web page).
# PID is the target process PID.
orxray analyzer run cpu-hogs -p PID
# trace a shell command directly
orxray analyzer run cpu-hogs -c SHELL_CMD
# PGID is the process group ID or any process's PID within the target process
# group.
orxray analyzer run cpu-hogs -p -PGID
# trace any processes started from the specified executable path.
orxray analyzer run cpu-hogs --exe /path/to/exe/file
Tracing Multiple Processes
Supported.
Output Formats
- Bar Charts
- Plain Texts
Output Example
[
{
"title": "CPU hogs of the system",
"subtitle": "",
"series": {
"data": {
"in": 0,
"script": 2,
"(sd-pam)": 10,
"(time-dir)": 13,
"NetworkManager": 6,
"aliyun-service": 31,
"systemd-udevd": 8,
"systemd-user-ru": 62,
"tail": 12,
"tuned": 2,
"nginx": 486,
"bash": 6
},
"name": "schedule count of process"
},
"ver": 1,
"type": "bar"
}
]
Author
The OpenResty Inc. Team.
Copyright
Copyright (C) by OpenResty Inc. All rights reserved.