In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use Linux's collectl tool". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use Linux's collectl tool.
Collectl is an excellent and useful program with rich command-line features that you can use to collect performance data that describe the current state of the system. Unlike most other system monitoring tools. Collectl is not limited to limited system metrics. On the contrary, it can collect information about many different types of system resources, such as cpu, disk, memory, network, sockets, tcp, inodes, infiniband, lustre, memory, nfs, processes, quadrics, slabs and buddyinfo.
Let's take a look at the following commands before we go any further.
$collectl
Waiting for1 second sample. . .
# cpu sys inter ctxsw KBRead Reads KBWrit Writes KBIn PktIn KBOut PktOut
00864177200000100
521338273400820001
1012222647009230201
107631722008030102
CPU usage, disk input and output, and network activity are loaded per second. The information is easy for people who can understand the data. This list continues to grow over a given interval and can directly form a file tracking log. The collectl tool provides a variety of commands to record, find, and do other processing of this data.
Install collectl tools
Collectl is the default resource for Ubuntu/Debian users, so you can get it using the apt command.
$sudo apt-get install collectl
Fedora/CentOS users can get it by using the yum command.
$yum install collectl
Use
Necessary understanding-Collectl subsystem
Subsystems are different types of system resources that can be detected. Such as CPU, memory, bandwidth and so on can form a subsystem. Running only the collectl command will output CPU, disk, and network subsystem information in batch mode, as we saw above.
As you can see from the instructions, Collectl can identify the following subsystems.
Total subsystem
B-buddy info (memory fragment)
C-CPU
D-Disk
F-NFS V3 Data
I-InodeandFileSystem
J-Interrupts
L-Lustre
M-Memory
N-Networks
S-Sockets
T-TCP
X-Interconnect
Y-Slabs (system object caches)
Detail subsystem
This is a series of details, which in most cases are derived from the corresponding total data. At present, there is no corresponding total data for the two categories "environment variables" and "processes". If you have three disks, select-sd, and you will only see a single message from a combination of three disks. If you select-sD, each disk information will be displayed separately.
C-CPU
D-Disk
E-Environmental data (fan, power, temp), via ipmitool
F-NFS Data
J-Interrupts
L-Lustre OST detail OR client Filesystem detail
M-Memory node data, which is also known as numa data
N-Networks
T-65 TCP counters only available in plot format
X-Interconnect
Y-Slabs (system object caches)
Z-Processes
Use "- s" to monitor a specific subsystem and add subsystem identifiers to it. Now let's give a few examples.
1. Monitor cpu utilization
Using "- sc" to monitor the total utilization rate of CPU
$collectl-sc
Waiting for1 second sample. . .
# "- CPU---"
# cpu sys inter ctxsw
3018003729
3017673599
Use "- C" to observe individual CPU usage. The result will be multiple lines, each corresponding to a CPU.
$collectl-sC
Waiting for1 second sample. . .
# SINGLE CPU STATISTICS
# Cpu User Nice Sys Wait IRQ Soft Steal Idle
0300000096
1300000096
2200000097
3100000098
0200000097
1202000095
2100000098
3401000095
If necessary, you can use both C and c to obtain individual CPU monitoring data and summary data.
two。 Memory monitoring
Use the m subsystem to view memory.
$collectl-sm
Waiting for1 second sample. . .
# "- Memory----"
# Free Buff Cach Inac Slab Map
2G220M1G1G210M3G
2G220M1G1G210M3G
2G220M1G1G210M3G
It's not hard to explain. M is used to view more memory details.
$collectl-sM
Waiting for1 second sample. . .
# MEMORY STATISTICS
# Node Total Used Free Slab Mapped Anon Locked Inact Hit%
07975M5939M2036M215720K372184K06652K1434M0
07975M5939M2036M215720K372072K06652K1433M0
3. View disk usage
D and D can view an overview and details of disk usage.
$collectl-sd
Waiting for1 second sample. . .
# "- Disks----"
# KBRead Reads KBWrit Writes
4113624
008013
$collectl-sD
Waiting for1 second sample. . .
# DISK STATISTICS (/ sec)
# "--reads---"- writes---"- averages---" Pct
# Name KBytes Merged IOs Size KBytes Merged IOs Size RWSize QLen Wait SvcTim Util
Sda 0000000000000
Sda 0000000000000
Sda 10211715322621
Sda 0000921151818112125
The "- verbose" command can be used to view additional information. Unlike the D command, it extends the profile to include more information.
$collectl-sd-verbose
Thank you for reading, the above is the content of "how to use Linux's collectl tools". After the study of this article, I believe you have a deeper understanding of how to use Linux's collectl tools, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.