The use of Linux system performance analysis tools

Source: Internet
Author: User
Tags time interval cpu usage

System Performance analysis Tools

The above sections describe several aspects of how Linux performance is affected and how to solve them, but how do you find out from the system that something is wrong with a certain aspect or a few aspects, which requires the use of several common performance analysis tools provided by the Linux system Here is a detailed account of the use of several common performance analysis tools.

1. Vmstat command

VMSTAT is the acronym for Virtual Meomory Statistics, which is installed by default in many Linux distributions, using the Vmstat command to monitor the operating system's memory information, process status, CPU activity, and so on. The disadvantage is that a process cannot be analyzed in depth.

Vmstat uses the following syntax:

Vmstat [-v] [-n] [delay [count]]

The various options and parameters have the following meanings:

L-v: Indicates that the version information is printed and is an optional parameter.

L-n: Indicates that the output header information is displayed only once when the output is periodically cycled.

L Delay: Represents the time interval between two outputs.

L Count: The number of times that the interval is specified according to "delay". The default is 1.

For example:

Vmstat 3

Indicates that the output information is updated every 3 seconds, the output is cycled, and CTRL + C stops the output.

Vmstat 3 5

Indicates that the output information is updated every 3 seconds, and the output is stopped after 5 times.

2. Iostat command

Iostat is an abbreviation for I/O statistics (input/output statistics), and the primary function is to monitor disk I/O operations on the system. Its output mainly shows the statistics of disk read and write operations, but also gives the CPU usage. Like Vmstat, Iostat can not analyze a process in depth, only the overall situation of the system analysis.

Iostat generally do not install with the system, to use the Iostat tool, you need to install a SYSSTAT toolkit on the system, Sysstat is an open source software, the official address is Http://pagesperso-orange.fr/sebastien.godard

You can choose the source code package or RPM package installation, here is not about the installation process, installation, the system will be more than 3 orders: Iostat, SAR and Mpstat. You can then run the Iostat command directly under the system.

Iostat uses the following syntax:

Iostat [-C |-d] [-K] [-t] [-X [Device]] [interval [count]]

The various options and parameters have the following meanings:

-C: Displays CPU usage.

-D: Displays the usage of the disk.

-K: Displays data in K bytes per second.

-T: Prints the time when the statistics start executing.

-X Device: Specifies the name of the disk device to be counted, and defaults to all disk devices.

Interval: Specify two times of statistical interval;

Count: The number of times that are counted according to the time interval specified by interval.

3. SAR command

SAR command is very powerful, is one of the important tools to analyze the performance of the system, through the SAR command, can fully obtain the system's CPU, run queue, disk I/O, paging (swap area), memory, CPU interrupt, network performance data.

SAR use format is:

SAR [options] [G1] [-o filename] [interval [count]]

The various options and parameters have the following meanings:

L options for command-line options, there are a lot of SAR commands, and the following lists only the common options:

-A: Displays the health of all resource devices (CPU, memory, disk) on the system.

-U: Displays the load status of all CPUs in the system during sampling time.

-P: Displays the usage of the specified CPU in the current system.

-D: Displays the usage of all hard disk devices for the system during the sampling time.

-r: Displays the usage in the system for sampling time.

-B: Shows how the buffer is used during the sampling time.

-V: Displays processes, files, I nodes, and lock table states.

-N: Displays network running status. Parameters can be followed by Dev, Edev, sock, and full. DEV Displays network interface information, EDEV display the network error statistics, sock display socket information, full display three all information. They can be used individually or together.

-Q: Shows the size of the run queue, which is the same as the average system load.

-r: Displays the activity of the process during the sampling time.

-y: Displays the activity of the terminal equipment during the sampling time.

-W: Displays the state of the system exchange activity during the sampling time.

L-o FileName: Indicates that the command result is stored in a binary format in a file, filename is the filename.

L Interval: Indicates the sampling interval time, is the necessary parameter.

L Count: Is the number of samples, an optional parameter, and the default value is 1.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.