[Linux] Linux uses sar for performance analysis

1. Mito

Insert picture description here

2. Overview

sar(System Activity Reporter, 系统活动情况报告): It is an excellent tool for monitoring the performance of Linux systems, including: file read and write conditions, system call usage, disk I / O, CPU efficiency, memory usage, process activities, and IPC-related activities.

3. Sar command common format

用法: sar [ 选项 ] [ <时间间隔> [ <次数> ] ]
选项:
[ -A ] [ -B ] [ -b ] [ -C ] [ -d ] [ -H ] [ -h ] [ -p ] [ -q ] [ -R ]
[ -r ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -V ] [ -v ] [ -W ] [ -w ] [ -y ]
[ -I { <中断> [,...] | SUM | ALL | XALL } ] [ -P { <cpu> [,...] | ALL } ]
[ -m { <关键词> [,...] | ALL } ] [ -n { <关键词> [,...] | ALL } ]
[ -j { ID | LABEL | PATH | UUID | ... } ]
[ -f [ <文件名> ] | -o [ <文件名> ] | -[0-9]+ ]
[ -i <间隔> ] [ -s [ <时:分:秒> ] ] [ -e [ <时:分:秒> ] ]

among them:

interval: 采样周期,单位是秒;
count:采样次数,默认值是连续采样;
options:命令行选项。

There are many options for the sar command. Only common options are listed below:

-A:所有报告的总和
-u:输出整体CPU使用情况的统计信息
-v:输出inode、文件和其他内核表的统计信息
-d:输出每一个块设备的活动信息
-r:输出内存和交换空间的统计信息
-b:显示I/O和传送速率的统计信息
-a:文件读写情况
-c:输出进程统计信息,每秒创建的进程数
-R:输出内存页面的统计信息
-y:终端设备活动情况
-w:输出系统交换活动信息

Later reference: https://blog.csdn.net/shenjian58/article/details/105212862

Published 1256 original articles · praised 465 · 1.59 million views

Guess you like

Origin blog.csdn.net/qq_21383435/article/details/105601212