Linux Server Resource Usage Summary

Source: Internet
Author: User
Tags memory usage system log cpu usage disk usage

The process that counts the highest memory:

PS aux | Grep-v PID | Sort-rn-k 4 | Head

To count the processes with the highest CPU utilization:

PS aux | Grep-v PID | Sort-rn-k 3 | Head

Zombie Process:

PS aux | grep defunct | Grep-v grep

To find the thread that the process started:

Ps-elf PID

To view Network Service status:

NETSTAT-NTLP--Displays the number format connection of the TCP that is being listening

Netstat-nulp--Displays the number format connection of the UDP being listening

Hardware Failure Analysis:

1. Check disk usage: whether the server hard disk is full.

2. Whether swap mode (SI/SO) is turned on.

3.CPU usage: A system process or user process that consumes high CPU time slices.

To view CPU and memory information:

Free-m

MEM is the capacity of physical memory.

Swap is the capacity of virtual memory.

Total is the overall capacity.

Used is the used capacity.

Free is the idle capacity.

GKFX is shared capacity.

Buff/cache is the buffer and cache capacity.

Avaiable for truly usable capacity.

The value of the general swap used should not exceed 20%.

Top--CPU and memory usage real stats

Mpstat 2 10--View usage statistics for each CPU.

Bus Device Information Statistics:

LSPCI-Displays all PCI bus devices in the system or all devices connected to the bus

Use the Dmidcode command to view information about the BIOS, system, memory, processor, and other hardware devices

Example: Dmidecode-t Memory | grep "Maximum capacity"

To view network card information:

Ethtool NIC Name

Ethtool-i Ens33

I/O performance statistics

Iostat-kx 2

Vmstat 2 10

SWPD: Switch to memory capacity on Swap memory (default is in kilobytes), and normally the value of SWPD is 0. If the value of SWPD is larger, if 100M is checked, but Si and so have a long value of 0, this situation does not affect performance.

Free: idle physical memory capacity. If the value of free is small, but the values of SI and so are also small, system performance is not affected.

Buff: Buffers The memory of the buffer cache, buffering the read and write of the block device.

Cache: Memory as page cache, file system caching, if the cache value is large, then the number of cached files, if the frequently accessed files can be cached, the name disk read IO bi (the number of blocks sent to the block device) will be very small.

Si: Swap memory usage, the disk is transferred into memory.

So: Swap memory usage, have memory to dial into disk.

Tip: When memory is sufficient, both SI and so values are 0, and if these two values are longer than 0, system performance will be affected, and disk, I/O, and CPU resources will be exhausted.

BI: The amount of data read from a block device (read disk) in kb/s.

Bo: The total amount of data written to the block device (write disk) in kb/s.

Tip: When the random disk reads and writes, these 2 values are larger (such as exceeding 1M), you can see the CPU in the I/O waiting value will be greater.

In: The number of endpoints produced per second.

CS: The number of context switches generated per second.

Tip: The greater the value of in and CS, the more CPU time the kernel consumes.

US: Percentage of CPU time consumed by the user process. If the value of us is higher, the user process consumes more CPU time. However, if the long term exceeds 50%, then consider optimizing the program algorithm or accelerating it.

SY: The percentage of CPU time consumed by the kernel process. If the value of SY is higher, it indicates that the system kernel consumes more CPU resources, this is not a benign performance, should check the cause.

The percentage of the ID:CPU in idle state time.

WA:I/O the percentage of CPU time that is waiting to be consumed. If the value of WA is higher, I/O wait is more serious, this may be caused by a large number of random access to disk, it may be the disk bandwidth bottlenecks, such as fast operation.

View the process information that currently consumes the most I/O resources, as shown in:

Dstat--top-bio--top-io

Disk usage Statistics:

Df-h--View disk capacity usage (check that disk space has not been released after deleting files)

Fdisk-l--View disk partition information

Disk I/O related reference: https://www.cnblogs.com/hanson1/p/7102206.html

The lsof command lists the files and directories that are open to the current system, providing a lot of information about the application itself and the interaction of the operating system. The +d parameter can list all subdirectories and files in the corresponding directory.

Operating system logs:

View overall system log:/var/log/messages

View licensing and certification information:/var/log/secure

The above two logs should pay attention to:

1) Error and alarm information, whether due to excessive number of connections caused by;

2) Whether there is a hardware error or a file system error.

Interrupt Exception Information:

Whether the interrupt request in the/proc/interrupts is evenly distributed to CPU processing, and whether the CPU is overloaded by a large number of network interrupt requests or RAID requests.

Kernel information query:

DMESG | More

Linux Server Resource Usage Summary

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.