Linux system Performance Troubleshooting commands

Source: Internet
Author: User
Tags dmesg

"Top"

command to dynamically view the current system's resource situation and the list of commands that occupy the resource

Usage:

-CTRL + C/Q: Stop this command to run

-C: Show the complete command

-"TOP-BN1": Can not dynamically show the current system's resource situation

-"uptime": the first line of load average can be seen by this command

$ uptime23:51:26 up 21:31,  1 user,  load average:30.02, 26.43, 19.02# first value: Represents the average load of 1 minutes # The second value: represents the average load of 5 minutes # The third value: represents the average load of 15 minutes # If the average load of 1 minutes is very high, 15 minutes is very low ==> system is executing high load commands, consuming a lot of CPU

"DMESG" ==>/VAR/LOG/DMESG

command to quickly view kernel log information during system startup, including: System device information, any errors and issues logged during startup and operation

Usage:

-"DMESG | More ": Print out a lot of content, you can use more to Page view

-"DMESG | Tail ": Print the last ten lines of log

"Vmstat 1 5"

Command output system core indicator information, 1 5 indicates 1 seconds output 5 times information

Usage:

-"R": the number of processes waiting for CPU resources, excluding processes waiting for IO {value if it is greater than the number of CPU cores, it indicates that the CPU resources of the machine are saturated}

-"Free": System available memory (in K units)

-"SI,SO": Swap writes and reads the number of swap, if the value is not equal to 0, then the machine physical memory is insufficient

-"Us,sy,id,wa,st": Indicates the user time, System (Kernel) time (SYS), idle time (idle), IO wait Time (wait), and stolen time (stolen, typically consumed by other virtual machines).

The user + sys result is particularly large = = "CPU Busy executing command

Wail is large = = "The bottleneck may be in disk IO

"Mpstat-p all 1"

command to display the number of CPUs, and the status of each CPU occupied,

If there is a particularly high CPU utilization, then it is possible that a single-threaded application is causing it.

"Pidstat 1"

The CPU utilization of the output process {will continue to be output and will not overwrite previous data}

From this command, you can infer how many CPU resources are consumed by calculating the time that a process consumes CPU

"Iostat-zx 1"

View machine disk IO status

Usage:

-"r/s, w/s, rkb/s, wkb/s": indicates read/write times per second and read/write data volume per second (KB) = = "This value indicates read-write, read-write volume is too large, can cause performance problems

-"await": the average wait time for an IO operation, {unit: Ms}, where the amount of time required to interact with the application and the disk (including the IO wait and the actual operation time), which is too large, may be the hardware device encountered a bottleneck or failure

-"Avgqu-sz": The average number of requests sent to the device, if this value is greater than 1, the hardware device may be saturated (some front-end devices support parallel writes)

-"%util": Device utilization, this value indicates how busy the device is, and if the experience is more than 60, it may affect IO performance (the average latency of the IO operation can be referenced). If you reach 100%, the hardware device is saturated.

If the data for the logical device is displayed, then the device utilization does not mean that the backend actual hardware device is saturated. It is worth noting that even if the IO performance is not good, it does not necessarily mean that the application performance will not be bad, can be used such as pre-read, write cache policies to improve application performance.

"Sar-n DEV 1"

View throughput rates for network devices

There is a need to understand the throughput limit for network devices, where it is possible to determine if the network device is saturated and unable to take greater access.

"Sar-n tcp,etcp 1"

View TCP connection Status

Parameters:

-active/s: Number of locally initiated TCP connections per second, TCP connections created through connect invocation;
-PASSIVE/S: The number of TCP connections initiated remotely per second, that is, the TCP connection created through the accept call;
-RETRANS/S: Number of TCP retransmissions per second;

The number of TCP connections can be used to determine whether the performance problem is due to excessive connections, which can be further judged by the active connection or the passively accepted connection.

TCP retransmission may be due to poor network environment, or excessive server pressure caused by packet loss.

Linux system Performance Troubleshooting commands

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.