Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the system tools under sysstat

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you what the system tools under sysstat are, which are concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

The Sysstat package integrates the following tools:

* iostat tool provides data on CPU utilization and disk throughput efficiency

* mpstat tool provides data related to a single processor or multiple processors

* the sar tool is responsible for collecting, reporting and storing information active in the system.

The sa1 tool is responsible for collecting and storing daily system dynamic information into a binary file. It is through the task planning tool

Cron to run

Is a front-end program designed for sadc

* the sa2 tool is responsible for writing daily system activity into summary reports. It is a front end designed for sar, through the

Cron to call

* sadc is a system dynamic data collection tool. The collected data is written into a binary file, which is used as a post-sar tool.

End

* sadf displays data collected by sar in various formats

One, SAR

The last two parameters of sar are usually interval count

Sar [parameter options]

Parameter description:

-A displays all the historical data by reading all the files in the / var/log/sar directory and displaying them by category

-b the throughput set by the device's Ithumb O interrupt read

-B reports memory or virtual memory swap statistics

-c reports the number of processes created per second

-d reports information such as writes and reads of physical block devices (storage devices). If it is more intuitive, it can be used with the p parameter

-dp

-f reads from a binary data file, such as sar-f filename

-I interval specifies the time (in seconds) for data collection

-n to analyze the statistics of the status of network equipment, the following parameters are DEV, EDEV, NFS, NFSD, SOCK and so on. For example,-n DEV

-o write statistics to a file, such as-o filename

-P reports application statistics per processor, for multiprocessor machines, and enabling the SMP kernel is effective

-p displays friendly device names for easy viewing, or can be used in conjunction with-d and-n parameters, such as-dp or-np

-r memory and swap area occupancy statistics

-R

The-t option is useful for reading data from a file. If this parameter is not available, it will be read out based on local time.

-u parameters for reporting CPU utilization

-v report resource occupancy information for inode, files, or other kernel tables

-w report on the exchange activities of the system; the number of data exchanged per unit

-W reporting system exchanging activity throughput information

-x is used to monitor the process, after which you want to specify the pid value of the process

-X is used to monitor the process, but should specify a child process ID

1. Sar-u 1 5

Output statistics on CPU usage, once per second, for a total of 100 times

17:06:01 CPU user nice system iowait idle

17:06:02 all 1.27 0.00 0.51 1.01 97.22

17:06:03 all 0.00 0.00 0.00 100.00

17:06:04 all 0.00 0.00 0.00 100.00

17:06:05 all 0.25 0.00 0.00 0.00 99.75

17:06:06 all 0.00 0.00 0.00 0.51 99.49

Average: all 0.30 0.00 0.10 0.30 99.29

CPU all indicates that the statistics are the average of all CPU.

% user displays the percentage of total time spent using CPU running at the user level (application).

% nice is displayed at the user level, as a percentage of the total CPU time spent on nice operations.

The percentage of total CPU time spent running system at the core level (kernel).

% iowait shows the percentage of total CPU time spent waiting for the IUnip O operation.

The percentage of steal hypervisor (hypervisor) waiting for virtual CPU while serving another virtual process.

% idle displays the percentage of total CPU time occupied by CPU idle time.

Tips:

If the value of% iowait is too high, it indicates that there is a bottleneck in the hard disk.

If the value of% idle is high but the system response is slow, it is possible that CPU is waiting to allocate memory. At this time, the memory capacity should be increased.

If the value of% idle is consistently lower than 10, the CPU processing capacity of the system is relatively low, indicating that the most important resource in the system is CPU.

.

2. Sar-b 1 5

Display statistics of Icano and transfer rate (dynamic real-time display of read and write of hard disk)

17:09:07 tps rtps wtps bread/s bwrtn/s

17:09:08 3.12 3.12 0.00 25.00 0.00

17:09:09 89.58 6.25 83.33 141.67 733.33

17:09:10 42.71 9.38 33.33 141.67 600.00

17:09:11 2.11 2.11 0.00 16.84 0.00

17:09:12 1.04 0.00 1.04 0.00 175.00

Average: 27.77 4.18 23.59 65.14 302.30

Total Istroke O transmissions of tps physical devices per second

The total amount of data that rtps reads from physical devices per second

The total amount of data written by wtps to the physical device per second

The amount of data read from a physical device by bread/s per second, in blocks per second

The amount of data written by bwrtn/s to the physical device per second, in blocks per second

3. Sar-c

Number of processes created per second

15:10:01 1.35

15:20:01 1.01

15:30:01 0.59

15:40:01 1.35

15:50:01 0.99

16:00:01 0.57

16:10:01 1.33

16:20:01 1.02

16:30:01 0.57

16:40:01 1.33

16:50:01 1.07

17:00:01 0.56

17:10:01 1.32

4. Sar-n DEV 1 5

Output statistics on the status of network devices

17:13:42 IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s

Rxmcst/s

17:13:43 eth2 3669.70 4156.57 368362.63 2747714.14 0.00 0.00

0.00

17:13:44 eth2 2689.11 2585.15 289661.39 701461.39 0.00 0.00

0.00

17:13:45 eth2 3746.00 4077.00 415178.00 2605720.00 0.00 0.00

0.00

17:13:46 eth2 3096.00 3241.00 327916.00 1597320.00 0.00 0.00

0.00

17:13:47 eth2 2910.00 2834.00 312632.00 957903.00 0.00 0.00

0.00

Average: eth2 3220.20 3375.60 342592.60 1717931.20 0.00 0.00

0.00

IFACE network device name

Total packets received by rxpck/s per second

Total number of packets transmitted by txpck/s per second

Total bytes received by rxbyt/s per second (byte)

Total number of bytes transmitted by txbyt/s per second (byte)

Total number of compressed packets received by rxcmp/s per second

Total number of compressed packets transmitted by txcmp/s per second

Total number of Multicast (multicast) packets received by rxmcst/s per second

5. Sar-Q 1 5

Output process queue length and average load status statistics

17:16:28 runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15

17:16:29 0 160 0.26 0.11 0.03

17:16:30 0 160 0.26 0.11 0.03

17:16:31 0 160 0.24 0.11 0.03

17:16:32 0 160 0.24 0.11 0.03

17:16:33 0 160 0.24 0.11 0.03

Average: 0 160 0.25 0.11 0.03

Length of runq-sz run queue (number of processes waiting to run)

Number of processes (processes) and threads (threads) in the plist-sz process list

Average system load in the last minute of the ldavg-1 (System load average)

Average system load of ldavg-5 over the past 5 minutes

Average system load of ldavg-15 over the past 15 minutes

6. Sar-r

Output memory and swap space statistics

Second, iostat

Use

Report Central processing Unit (CPU) statistics and input / output statistics for the entire system, adapters, tty devices, disks, and CD-ROM

information.

Grammar

Iostat [- s] [- a] [- d |-t] [- T] [- m] [PhysicalVolume...] [Interval [Count]

]

Description

The iostat command is used to monitor the system input / output device load by observing the physical disk's

Activity time to achieve. The report generated by the iostat command can be used to change the system configuration to better balance between the physical disk and the adapter

The input / output load of

The first report generated by the iostat command provides time statistics since the system was booted. Every subsequent report

All contain the time since the last report. Every time you run the iostat command, all statistics are reported. The report is immediately followed by

Consists of a row of tty and CPU headers for tty and CPU statistics. On multiprocessor systems, CPU statistics are system wide

The average of all processors is calculated.

If you specify the-s flag, the system header line is displayed, followed by a line of statistics for the entire system. The hostname of the system is printed on the system

On your head.

If you specify the-a flag, an adapter header line is displayed, followed by a row of adapter statistics. There will be a magnetic field behind this.

Statistics for the header line and all disks / CD-ROM connected to the adapter. Generate this report for all disk adapters connected to the system

Sue.

Displays a disk header line, followed by statistics for one line of configured disks. If the PhysicalVolume parameter is specified, only the

Those specified names.

If you specify the PhysicalVolume parameter, you can specify one or more alphanumeric physical volumes. If you refer to

When you set the PhysicalVolume parameter, the tty and CPU reports are displayed and the disk report contains statistics for the specified drive. Such as

If the specified logical drive name is not found, the report lists the specified name and displays a message that the drive was not found. If not,

The logical drive name is specified, and the report contains statistics for all configured disks and CD-ROM. If the drive is not configured on the system

No disk report is generated. The first character in the PhysicalVolume parameter cannot be numeric.

The Interval parameter specifies the amount of time in seconds between each report. The first report includes starting (booting) the system to

Time statistics from. Each subsequent report contains statistics collected during the interval between the previous report and the previous report. Count

Parameters can be specified to connect Interval parameters. If the Count parameter is specified, its count value is determined within Interval seconds

The number of reports generated. If the Interval parameter is specified but there is no Count parameter, the iostat command continues to generate reports.

The iostat command is used to determine whether a physical volume is creating a performance bottleneck and whether it is possible to improve the situation. Physical volume

The% usage field indicates how evenly the file activity is distributed in the drive. The high utilization rate of physical volumes indicates that this may exist.

The competition for resources is a good sign. Since the statistics on CPU usage also apply to iostat reports, CPU is waiting in the queue at Icano.

The percentage of time in the column can be determined at the same time. If the Imap O wait time is a valid number and the disk utilization is not on the volume

Evenly distributed, then consider distributing data on the drive.

Note: some system resources are consumed to maintain the history of disk Icano for the iostat command. Use the sysconfigsubroutine

Or the system Management Interface tool (SMIT) to stop the history account.

Report

The iostat command generates four types of reports, tty and CPU usage reports, disk usage reports, system throughput reports, and appropriate

Orchestration throughput report.

Tty and CPU usage report

The first report generated by the iostat command is the tty and CPU usage report. For multiprocessor systems, the CPU value is all

The total average of the manipulator. At the same time, the Imap O wait state is defined at the system level, not per processor. The report has the following format:

Column description

Tin shows the total number of characters read by the system for all tty.

Tout shows the total number of characters written by the system for all tty.

% user shows the percentage of CPU usage generated at the user level (application) execution.

% sys shows the percentage of CPU usage generated during system-level (kernel) execution.

% idle shows the percentage of time when CPU is idle and the system does not have outstanding disk IDUBO requests.

% iowait shows the percentage of time when the system has outstanding disk Icano requests during the CPU idle.

At regular intervals, the kernel updates this message (usually 60 times per second). The tty report provides information from all terminals in the system

The total number of characters received per second, and the total number of characters output per second to all terminals of the system.

The method used to calculate the waiting time of CPU disk

Operating system V4.3.3 and later versions contain hundreds used to estimate the amount of time CPU spent waiting on disk I wio O (disk time)

The enhancement method of the ratio. The method used in AIX 4.3.2 and earlier versions of the operating system can be given on SMP under certain conditions.

An enlarged view of the wio time of Wio time is based on the commands sar (% wio), vmstat (wa), and iostat (%

Iowait) reported.

The method used in AIX 4.3.2 and earlier is as follows: in each clock per processor (100 times per second)

When broken, it determines which of the four categories (usr/sys/wio/idle) is placed in the last 10ms. If it's in the clock,

If the CPU is busy in usr mode at the time of the break, then usr gets the timing point and assigns it to this category. If the clock is interrupted

When the CPU is busy in kernel mode, the sys category will get the timing point. If CPU is not busy, it will check the

Check to see if any disk Ibank O is in progress. If you are doing any disk Ihop O, the wio category will be increased. If the disk is in the process of IBG O

Operation and CPU is not busy, then the idle category will get the timing point. An enlarged view of wio time is due to the fact that all idle CPU are returned

Caused by the number of threads waiting on wio regardless of the number of threads waiting on Ibank O. For example, a system with only one thread executing Igamo can report more than

90% of the wio time regardless of the number of CPU.

The method used in AIX 4.3.3 and subsequent releases is as follows: if you start an unfinished IMaple O on that CPU, then

The change in operating system V4.3.3 marks only one idle CPU as wio. When only a small number of threads are executing Igamo, otherwise the system will

This method can report less wio time when you are idle. For example, one has four CPU and only one thread executes I.

The / O system will report a wio time with a maximum value of 25%. One that has 12 CPU and only one thread executes iThread O

The system reports a wio time with a maximum value of 8%. The NFS client reads / writes through VMM, and in order to complete an Imax O

The time spent in the vmm wait will now be reported as the Imax O wait time.

Disk usage report

The second report generated by the iostat command is the disk usage report. Disk reports provide statistics on a per-physical disk basis

information. This report has the following similar format:

% tm_act represents the percentage of time that the physical disk is active (bandwidth usage of the drive).

Kbps represents the amount of data transferred (read or write) to the drive in KB per second.

Tps represents the number of transfers per second output to the physical disk. A transfer is an Icano request to a physical disk. Multiple logic, please.

The request can be combined as a single Icano request to the disk. The transmission has a medium size.

Total number of KB read by Kb_read.

Total number of KB written by Kb_wrtn.

Statistics for CD-ROM devices are also reported.

For large system configurations with a large number of disks, the system can be set to avoid collecting physical hard drives when iostat is not executed

Input / output data. If the system is configured in the manner described above, the first disk report will display the disk after the message boot is not available

History rather than disk statistics. Subsequent interval reports generated by the iostat command are included during the reporting interval

Disk statistics for the set. Any tty and CPU after boot will not be affected. If a system management command is used to re-retain magnetism

Disk statistics, then the first iostat command report shows the time interval from the moment when disk input / output statistics are enabled

The act of lighting up.

System Throughput report

If you specify the-s flag, this report will be generated. This report provides statistics for the entire system. The report has the following format:

Kbps represents the amount of data transferred (read or write) to the entire system in KB per second.

Tps represents the number of transfers per second to the entire system.

The total number of KB read by Kb_read from the entire system.

Kb_wrtn writes to the total number of KB for the entire system.

Adapter Throughput report

If you specify the-a flag, the report will be generated. This report provides statistics on the adapter.

Kbps represents the amount of data transferred to (read or write) to the adapter in KB per second.

Tps represents the number of transfers output to the adapter per second.

The total number of KB read by Kb_read from the adapter.

The total number of KB written to the adapter by Kb_wrtn.

Disk input / output history

To improve performance, the disk input / output statistics collection has been disabled. To enable the collection of this data, enter:

Chdev-l sys0-an iostat=true

To display the current settings, enter:

Lsattr-E-l sys0-an iostat

If the collection of disk input / output histories is disabled, the first disk report of the iostat output will show the message that the boot is not

Disk history instead of disk statistics after being available. As before, the subsequent interval report generated by the iostat command contains the

Disk statistics collected during the reporting interval.

Mark

-a displays the adapter throughput report.

The-d-d flag cannot be used with the-t flag and only the disk usage report is displayed.

-s displays the system throughput report.

The-m-m flag will print path statistics for the following

The path to the MPIO (Multi-Path Iplink O) enabled device.

The path in the ESS machine.

Throughput is per device. The throughput of all paths of the device matches the throughput of the device.

For ESS machines, vpaths will be treated as a disk and hdisks as a path. Inside vpaths is the disk, hdisks

It's their path. For MPIO-enabled devices, pathnames are represented as Path0, Path2, Path3, and so on. The numbers 0, 1, 2

And so on are path identifiers provided by the lspath command. Because the path of a device can be attached to any adapter, the adapter reports

The path information under each adapter will be reported. The disk name is the prefix for all paths. For all MPIO-enabled devices, adapt

The report will print path names as hdisk10_Path0, hdisk0_Path2, and so on. For all ESS machines, the adapter report will hit

Print the path name as vpath0_hdisk3, vpath20_hdisk25, and so on.

The-t-t flag excludes the-d flag and only tty and cpu usage reports are displayed.

-T prints the time stamp on each line of iostat output. The timestamp is displayed in HH:MM:SS format.

Note:

Both the-s and-a flags can be specified to display system and adapter throughput reports.

If you specify both the-a flag and the-t flag, the tty and CPU reports are displayed, followed by the adapter throughput report. Connect in the right place

The utilization report of the disk on the adapter will not appear after the adapter throughput report.

If you specify both the-a flag and the-d flag, the tty and CPU reports are not displayed. If you specify physical volume parameters, specify

The disk utilization report for the volume will be printed under the appropriate adapter to which it belongs.

Example

To display a single history report after boot for all tty, CPU, and disks, enter:

Iostat

To display a persistent disk report with a two-second interval for a disk with a logical name of disk1, enter:

Iostat-d disk1 2

To display six reports with a two-second interval for a disk with the logical name disk1, enter:

Iostat disk1 2 6

To display six reports with a two-second interval for all disks, enter:

Iostat-d 2 6

To display six reports in two-second intervals for three disks named disk1, disk2, and disk3, enter:

Iostat disk1 disk2 disk3 2 6

To print the system throughput report, enter:

Iostat-s

To print the adapter throughput report, enter:

Iostat-a

To print system and adapter throughput reports with only tty and CPU reports (no disk reports), enter:

Iostat-sat

To print a system and adapter throughput report with disk usage reports for hdisk0 and hdisk7, enter:

Iostat-sad hdisk0 hdisk7

To display the timestamp of the next line of each line of iostat output, enter:

Iostat-T

File

The total number of tps O transmissions per second for physical devices.

The total amount of data read by Blk_read, in blocks.

The total amount of data written by Blk_wrtn, in blocks.

The total amount of data read by kB_read, in KB.

The total amount of data written by kB_wrtn, in KB.

The total amount of data read by MB_read, in MB.

The total amount of data written by MB_wrtn, in MB.

The amount of data that Blk_read/s reads from the drive per second, in blocks per second.

The amount of data that Blk_wrtn/s writes to the drive per second, in blocks per second.

The amount of data, in KB/s, that kB_read/s reads from the drive per second.

The amount of data, in KB/s, that kB_wrtn/s writes to the drive per second.

The amount of data, in MB/s, that MB_read/s reads from the drive per second.

The amount of data, in MB/s, that MB_wrtn/s writes to the drive per second.

The number of read requests sent to the device per second after rrqm/s merges read requests.

The number of write requests sent to the device per second after wrqm/s merges write requests.

The number of read requests sent to the device by rbarb per second.

The number of write requests sent to the device by whand per second.

The number of sectors read from the device by rsec/s per second.

The number of sectors written to the device by wsec/s per second.

The amount of data read from the device by rkB/s per second, in KB/s.

The amount of data written by wkB/s to the device per second, in KB/s.

The amount of data read from the device by rMB/s per second, in MB/s.

The amount of data written by wMB/s to the device per second, in MB/s.

The average size, in sectors, of requests sent by avgrq-sz to the device.

The average queue length of requests sent by avgqu-sz to the device.

The average execution time of the await IPUBO request. Including the time to send the request and execute. In milliseconds.

The average execution time of the Istroke O request sent by the svctm to the device. In milliseconds.

The percentage of CPU time consumed by% util during the time the CPU O request was sent to the device. Used to display the bandwidth utilization of the device. When this value is picked up

When it is nearly 100%, the device bandwidth is full.

Three, mpstat

Mpstat provides statistics on the utilization of CPU in multiprocessor systems; mpstat can also add parameters to specify which CPU and location with-P

The ID of the controller starts at 0. The following example is to view two processors, update the data every two seconds, and display the data a total of 10 times

[root@localhost] # mpstat-P 0 210 Note: view the first CPU

[root@localhost] # mpstat-p 1 2 10 Note: view the second CPU

[root@localhost ~] # mpstat-P ALL 2 10 Note: view all CPU

What are the above contents of the system tools under sysstat? have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report