Installation under Linux sysstat Detailed graphics

Sysstat, has now released the latest version 12.1.6 , Sysstat is a commonly used software toolkit in Linux server system can be used to monitor the performance of the server. For example, you can monitor CPU, hard disk, network and other data, we can be used for the efficient use of resources and performance analysis server. We will learn in this article, use Sysstat monitoring kit installation and frequently used commands.

Under Linux, we use multi-server ssh link remote control. For the monitoring system is essential, sysstat very good monitoring tool bag.

Sysstat to make an introduction: "SYSSTAT is a software package that contains a set of tools for monitoring system performance and efficiency of these tools for us to collect performance data, such as CPU utilization, disk and network throughput data collection and analysis of these data It will help us determine whether the normal operation of the system is to improve the efficiency of the system, the safe operation of the server's right-hand man. "

Installation under Linux sysstat Detailed graphics

Installation under Linux Sysstat performance monitoring tools

Current mainstream Linux systems are integrated package comes with sysstat

Or apt-get install sysstat

2, Git installation package

yum install -y git
git clone git://github.com/sysstat/sysstat
cd sysstat
./configure
make &&make install

yum -y install sysstat

3, check whether successful (as of August 15, 2019, sysstat latest version 12.1.6), after installation, use the command to check whether you can see the current version.

As shown below:

Installation under Linux sysstat Detailed graphics

See on the map, it means Sysstat successful installation.

Linux under sysstat use:

sysstat kit contains tools:

  • iostat tool provides CPU usage and hard disk throughput efficiency of data; # more central tool
  • mpstat tools provide a single processor or a plurality of data processors;
  • pidstat: statistical information about running processes / tasks, CPU, memory, etc.
  • sar tool is responsible for collecting, reporting and active storage system information; # core tools of statistical data
  • sa1 tool collects and stores dynamic information system every day to a binary file. It is run by the Scheduled Tasks tool cron, sadc designed for front-end program program;
  • sa2 tool responsible for daily system activity information in the report's summary. It is for the front-end sar designed to be invoked by cron
  • sadc dynamic data collection tool system, data collection is written in a binary file, which is used as a backend sar tool;
  • sadf sar by displaying the collected data in multiple formats;
  • nfsiostat: NFS (Network File System) of I / O statistics.
  • cifsiostat: CIFS (Common Internet File System) statistics

The main tool usage instructions sadc it contains, sdaf, sar, iostat, mpstat of.

View command parameters: xxx --help

[ <interval> [ <count> ] ] [ <outfile> ]

The number of output files spacing s

1、iostat

As shown below:

Installation under Linux sysstat Detailed graphics

Interpretation parameters:

-c: Only status cpu
-d: Display only state storage device, and can not be used with -c
-k: default display information reading the block read out by -k display size can be changed to KB -m
-t: displays the date
-p device | ALL:
device is a device or a partition, if you use ALL, it means you want to display information about all partitions and devices

Example:

linuxidc@linuxidc:~/www.linuxidc.com$ iostat -c 1 3
Linux 5.2.5-050205-generic (linuxidc)     08/15/2019     _x86_64_    (1 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           4.28    0.07    5.65    9.88    0.00   80.12

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           6.78    0.00   27.97    0.00    0.00   65.25

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.00    0.00    4.00    0.00    0.00   94.00

-x extended status display, showing more

avg-cpu:  %user  %nice %system %iowait  %steal  %idle
          4.25    0.07    5.53    9.61    0.00  80.55

As shown below:

Installation under Linux sysstat Detailed graphics

Description:

rrqm / s: the number of read operations performed per second merge. I.e. Delta (rmerge) / S
wrqm / S: merge number of write operations performed per second. I.e. Delta (wmerge) / S
R & lt / S: second reading completion of I / O devices. I.e. Delta (Rio) / S
W / S: second write completion of I / O devices. I.e. Delta (wio) / S
Rsec / S: Read the number of sectors per second. I.e. Delta (rsect) / S
Wsec / S: write the number of sectors per second. I.e. Delta (wsect) / S
rkB / S: K bytes per second read. It is half rsect / s, as each sector size is 512 bytes. (Calculated required)
WKB / S: K bytes per write. It is wsect half / s. (Calculated required)
avgrq-SZ: the average size of the device each data I / O operations (sector). Delta (rsect wsect +) / Delta (Rio + wio)
avgqu-SZ: average I / O queue length. I.e., delta (aveq) / s / 1000 ( because of AVEQ milliseconds).
await: Average waiting time per device I / O operations (in milliseconds). I.e. Delta (Ruse Wuse +) / Delta (Rio + wio)
the svctm: Average per-device I / O operations service time (in milliseconds). I.e. Delta (use) / Delta (Rio + wio)
% util: one second how many percent of the time for I / O operations, or how much time is one second I / O queue is not empty.
delta (use) / s / 1000 ( as use of milliseconds) If% util close to 100%, indicating that the generated I / O requests too, I / O system has been at full capacity, the disk may be a bottleneck.
less than 70% IO idle pressure is large, and generally have more speed read wait. #CPU idle time

2、mpstat

mpstat for the utilization of multi-processor system CPU statistics. Parameter may be used to refine the specific -P state of a cpu, processor ID from zero

mpstat

mpstat

Description:

% user displays the percentage of total CPU time used at the user level (file application) operation.
% nice displayed at a user level, a nice operation, the total percentage of time occupied by CPU.
% system at the kernel level (Kernel) run percentage of the total CPU time used.
% iowait show the percentage of waiting I / O operation takes a total time of the CPU.
% irq displayed in the interval period, the total hardware interrupt CPU time occupied.
% soft shown in the interval period, the total soft interrupt CPU time occupied.
% steal management program (hypervisor) to provide services to another virtual process while waiting for the percentage of virtual CPU.
% idle CPU idle time display occupancy percentage of the total time of the CPU.
intr / s in the internal time period, CPU receives the second number of interruptions.

3、sadc

sadc located in / usr / local / lib / sa / directory (Ubuntu 18.04 LTS), if you do not set the executable path, use the absolute path to run.

sdac just a collection of writing tool, not directly echo on the screen. sadc is to write data in a binary file, if you want to view the data content, sadf needed tools to display.

As shown below:

Installation under Linux sysstat Detailed graphics

Note: This tool parameters are optional, if you do not specify any parameters

Such as / usr / local / lib / sa / sadc - (later "-" is required, and less error will be garbled), the data is output to a file in / var / log / sa / directory.

Installation under Linux sysstat Detailed graphics

To view or by sadf sar tool.

As shown below:

sadc

4, flas

sadf extracting data from a binary file sar collected; sar format is not as intuitive, which is mainly used to derive CSV, XML file format, database or the like easy to import excel program.

As shown below:

Installation under Linux sysstat Detailed graphics

5, sar

sar tool more powerful, both collection system CPU, hard disk, dynamic data, can also display a dynamic display, better view binary data files; sar more applications, but also more complex, more accurate data. We only look at popular content on the line, most of what we understand on the line.

As shown below:

Installation under Linux sysstat Detailed graphics

Parameter Description:

-A show all the historical data, by reading / var / log of all files in the directory sar /, and sorted is displayed;
-b read throughput provided by the device I / O interruption;
-B report memory or virtual memory swap statistics;
number of processes -c create reports per second;
information is written -d report physical block devices (storage devices), the reading and the like, if a little intuitive, and p parameters can be used together, -dp
-f read from a data file in a binary content, such sar -f filename
time -i interval specified data collection, time in seconds;
statistical analysis -n network device status, parameters can be followed contact DEV, EDEV , NFS, NFSD, SOCK and so on. For example DEV -n
-o the statistics are written to a file, such as filename -o;
-P statistical reports for each application processor for multiprocessor machines, and enable SMP kernel to be effective;
-p-friendly device name display, for easy viewing, and it can also be used in conjunction with -d and -n parameters, such as -dp or -NP
-r memory and swap occupancy statistics;
-R
-t this option is useful for reading data from a file, if this parameter is not It will read the local time as the standard;
-u CPU utilization reporting parameter;
-v report resources inode, file, or other kernel occupancy information table;
-w exchanging information reporting system activity; each small number of exchanging data;
-W reporting system throughput information exchange activities;

# Version of the new high added
-x used to monitor the process, to be specified in the subsequent process PID value;
-X is used to monitor the process, but it should be designated a child process ID

Note: If only the sar command, sar is to read the most recent system state files in / var / log / sa directory. sar -A reads all file data in / var / log / sa directory.

linuxidc@linuxidc:~/www.linuxidc.com$ sar -u 1 5
Linux 5.2.5-050205-generic (linuxidc)     08/15/2019     _x86_64_    (1 CPU)

02:57:46 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
02:57:47 AM     all      0.00      0.00      2.04      0.00      0.00     97.96
02:57:48 AM     all      8.25      0.00      5.15      0.00      0.00     86.60
02:57:49 AM     all      2.08      0.00      0.00      0.00      0.00     97.92
02:57:50 AM     all     27.27      0.00     12.12      0.00      0.00     60.61
02:57:51 AM     all     44.58      0.00     16.87      0.00      0.00     38.55
平均时间:     all     15.64      0.00      6.98      0.00      0.00     77.38

sar -n DEV 2 4 # View network device network throughput

As shown below:

sar

Interpretation parameters:

IFACE: device name;
rxpck / S: received packets per second;
rxbyt / S: the number of all received packets per second;
txbyt / S: the number of all packets sent per second;
txbyt / S: transmitting per second the size of all packets;
rxcmp / S: the number of packets received per second, the number of compressed data;
TxCMP / S:; compressed data transmission packets per second
rxmcst / s: the number of received multicast packets per second ;

Want to get traffic situation of a piece of card, we can use grep filter. #sar -n DEV 2 4 | grep eth0

01:55:04 AM    CPU    %user    %nice  %system  %iowait    %steal    %idle
01:55:07 AM    all    24.77      0.00    75.23      0.00      0.00      0.00
01:55:08 AM    all    30.00      0.00    70.00      0.00      0.00      0.00
01:55:09 AM    all    16.67      0.00    83.33      0.00      0.00      0.00
01:55:10 AM    all    26.67      0.00    73.33      0.00      0.00      0.00
01:55:11 AM    all    19.35      0.00    80.65      0.00      0.00      0.00
01:55:12 AM    all    25.81      0.00    74.19      0.00      0.00      0.00
01:55:13 AM    all    16.67      0.00    33.33    50.00      0.00      0.00
01:55:14 AM    all    18.18      0.00    28.57    53.25      0.00      0.00
01:55:15 AM all 22.86 0.00 38.57 38.57 0.00 0.00
Average time: all 22.11 0.00 57.02 20.87 0.00 0.00

Installation under Linux sysstat Detailed graphics

6、pidstat

As shown below:

Installation under Linux sysstat Detailed graphics

Installation under Linux sysstat Detailed graphics

 

Details of sysstat : click here
Download sysstat of : click here

Guess you like

Origin www.linuxidc.com/Linux/2019-08/160082.htm