Introduction to common linux performance monitoring tools and linux performance monitoring tools

Source: Internet
Author: User

Introduction to common linux performance monitoring tools and linux performance monitoring tools

Record several frequently used ones.

1. top/htop

As we all know about top, there are several common parameters: (you can also start and interact)

-D: Set the delay time-S: accumulative time mode k: End Process q: Exit topZ: change the color template l: average load and system running time display switch m: memory and swap space usage display switch t: current task and CPU Status display switch c: command line or process name f, o: add and remove process information fields and adjust the display sequence of process information fields H: display thread S: Time accumulative mode u: monitor specific user-related processes

Htop has an Ncurses interface that supports mouse control and features similar to top. It is an improved branch of top.

2. netstat

Note: The root permission is required to display certain information.

For example, netstat-tunlp

-A or -- all: displays the sockets in all connections;-A <network type> or -- <network type>: lists the related addresses in the network type connections;-c or -- continuous: continuously list the network status;-C or -- cache: displays the cache information of the vro configuration;-e or -- extend: displays other network-related information;-F or -- fib: displays FIB; -g or -- groups: display the member list of the Multi-Broadcast Function Group;-h or -- help: online help;-I or -- interfaces: display the network interface information form; -l or -- listening: display the Socket of the monitored server;-M or -- masquerade: display the disguised network connection;-n or -- numeric: Use the IP address directly, instead of using the Domain Name Server;-N or -- netlink or -- symbolic: display the symbolic connection name of the network hardware peripheral device;-o or -- timers: display the timer;-p or -- programs: show Soc in use Ket program identification code and program name;-r or -- route: displays the Routing Table;-s or -- statistice: displays the statistical Table of network work information;-t or -- tcp: display the connection status of TCP transmission protocol;-u or -- udp: display the connection status of UDP transmission protocol;-v or -- verbose: display the command execution process;-V or -- version: display version information;-w or -- raw: display the connection status of the RAW transmission protocol;-x or -- unix: the effect of this parameter is the same as that of the specified "-A unix" parameter; -- ip or -- inet: the effect of this parameter is the same as that of the specified "-A inet" parameter.
3. free [1]

-B: memory usage is displayed in bytes;

-K: displays memory usage in KB;

-M: memory usage is displayed in MB;

-O: the buffer adjustment column is not displayed;

-S <interval seconds>: continuously observe the memory usage;

-T: displays the total memory column;

-V: displays version information.

Difference between free command buff and cache [4]
[Root @ iz8vb8kca7twx6177bq1_fz ~] # Free-htotal used free shared buff/cache availableMem: 1.8G1.1G 74 M 372 K 621 M 539 MSwap: 0B 0B 0B 0B
Buff Cache

Buffer: a buffer used to transmit data between devices with non-synchronous speeds or between devices with different priorities. The Buffer can reduce the waiting time for inter-process communication, when a device with high storage speed communicates with a device with low storage speed, the device with low storage speed first stores the data in the buffer, so that the device with high storage speed can read the data in the buffer, during this period, the CPU of the device that stores fast data can be searched to do other things.

Cache: the Cache area is a high-speed Cache. It is a memory with a small capacity but fast speed between the CPU and the primary memory, because the CPU speed is much higher than the primary memory speed, it takes a long time for the CPU to read data from the memory. The Cache stores the data that has just been used by the CPU or some data that is used cyclically, and reads data from the Cache faster, this reduces the CPU wait time and improves the system performance.
Buffer: It is generally used to write data to a disk. For example, a process requires that multiple fields be read. When all required fields are read, the fields that have been read are first put into the buffer. The Cache is not a Cache file, but a Cache block (the block is the smallest unit of I/O read/write). The Cache is generally used for I/O requests, if multiple processes want to access a file, they can read the file into the Cache. In this way, the next process obtains CPU control and directly reads the file from the Cache to improve system performance.

SYSSTAT

Sysstat includes a series of tools

Pidstat [3]

1. List IO statistics:-d

2. List memory usage statistics, page fault:-r

3. CPU statistics:-u

4. Statistics on context switching:-w

5. Specify the output dimension

Specify command:-C command

Process ID:-p {pid [,...] | SELF | ALL}

Output all columns to a single row for easy import into a single table:-h

Statistics per CPU core:-I

Statistics by all CPU cores: Default

List the complete content of the command, including the parameter-l

List thread statistics:-t

Separate statistics by Process Dimension, separate statistics by process global + sub-process, global statistics by process, separate statistics by sub-TASK at the same time:-T {TASK | CHILD | ALL}

Vmstat [5]

$ Vmstat 1 second refresh

Procs ----------- memory ---------- --- swap -- ----- io ---- system -- ----- cpu ------

R B swpd free buff cache si so bi bo in cs us sy id wa st

Important parameters:

Swpd: The used SWAP space, in KB.

Free, available physical memory size, in KB.

Buff, the buffer size of the physical memory used to cache read/write operations, in KB.

Cache, which is used to cache the size of the process address space in KB.

Si, the size of data read from SWAP to RAM (swap in), in KB;

So, the size of data written from RAM to SWAP (swap out), in KB.

Related Article

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.