In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Sar command
1.sar detailed explanation
SAR is an acronym for system activity report (System Activity Report). As its name suggests, SAR is a command used in Unix and Linux operating systems to collect, report, and save CPU, memory, input and output port usage. The SAR command can generate reports dynamically or save them in a log file.
Common parameters
-b: report the usage of Iamp O and the transfer rate. (only available for kernels 2.5 and earlier, so the new kernel may not support this option)
-B: report the usage of the Page
-c: report process creation
-d: report the usage of each block device
(when you use it, you will find a string in the DEV column similar to the dev1-7 format
Where 1 represents the main sequence number of the device, and n represents the slave sequence number of the device.
And the unit of rd_sec/s column and wr_sec/s column is 512bytes, that is, 512B, that is, 0.5KB)
-I: report the interruption
-n: report on the network
-P: set CPU
-Q: report queue length and load information
-r: report memory and swap usage
-R: report memory status
-u: report CPU usage
-v: report I nodes, files and other kernel table information
-w: report the system context switch
-x: statistics can be given for a specific PID
You can specify the process ID number directly
You can also specify SELF, which detects the sar process itself
If set to ALL, all system progress information is reported.
-X: report information about child processes of a specific PID
-y: sets the information for the TTY device.
Sar needs to install yum install-y sysstat
Example: view the information of cpu
Sar-u
Example: sar takes 10 samples at an interval of 5 seconds
Sar 5 10
Example: use the-r option to generate a memory usage report (5 times every 2 seconds)
Sar-r 2 5
Example: generate a paging statistics report with the-B option (5 times every 2 seconds)
Example: use the-d option to generate a block device usage report (4 times every 2 seconds)
Sar-d-p 2 4
The-d option is used to display the status report of the block device in the sar command. Adding the-p (pretty-print) option after-d enhances the readability of the dev column
Example: generate network usage report with-n (2 times per second)
The-n option is used in the sar command to generate statistical reports on network usage. Here are the grammar rules:
# sar-n {keyword} or {ALL}
Sar-n DEV 1 2
Example: read the sar log file with-f
Sar-Q can view the system history load
Sar-b 1 10 can view the current disk io status
Sar-n DEV 1 10 can view network card traffic
How do I use sar to view historical loads, such as the 19th load?
Sar-Q-f / var/log/sa/sa19
Sar-p 1 10 can view the usage of cpu
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.