Troubleshoot several common Linux commands on online issues

Source: Internet
Author: User
Tags cpu usage

Top

Equivalent to Windows Task Manager

you can see that the output is divided into two parts, the first 5 rows is the overview, the following is the specific process resource usage. take a look at the following line

Line 1th

top-18:14:58 up, 1:35, 1 user, load average:0.00, 0.10, 0.11

In turn, the current time, the time the system has been running, the number of users currently logged on, the system in the last 1 minutes, 5 minutes, 15 minutes of load

(PS:

From this line we can know the following information

    • Current time is 18:14:58
    • The system has been running for 112 days, 1 hours, 35 minutes.
    • There are currently 1 users logged in
    • In the last 1 minutes, 5 minutes, 15 minutes of load were 0.00, 0.10, 0.11

Load exceeding 1 means overload

Line 2nd

tasks:225 Total, 1 running, 224 sleeping, 0 stopped, 0 zombie

Process information

    • Total process Totals
    • Number of processes running in running
    • Sleeping the number of processes in sleep
    • Stopped number of processes stopped
    • Zombie Number of zombie processes

(PS: from this line we can see that a total of 225 processes are currently )

Line 3rd

Cpu (s): 1.8%us, 0.9%sy, 0.0%ni, 97.1%id, 0.1%wa, 0.0%hi, 0.1%si, 0.0%st

CPU Usage

US: User process consumes CPU percentage

SY: Kernel process consumes CPU percentage

NI: process that has changed precedence consumes CPU percentage

ID: Percentage of idle CPU

Wa:io The waiting process consumes CPU percentage

Hi: Percentage of hard interrupts consuming CPU

Si: The percentage of CPU that the soft interrupt consumes

St:

Line 4th

mem:32879852k Total, 23633040k used, 9246812k free, 311552k buffers

Physical Memory usage

    • Total Memory Size
    • Used already in use
    • Free not used
    • Buffers Kernel buffers

Available memory = Free + buffers + Cached

Line 5th

swap:4194300k Total, 255104k used, 3939196k free, 10422508k cached

Virtual Memory usage

Remaining rows

Free-m

View used and unused memory conditions

Mem total = used + Free

Swap total = used + Free

Available memory = Free + buffers + Cached

(-buffers/cache) Number of used memory = used–buffers–cached in mem line

(+buffers/cache) Free memory = Free + buffers + cached in mem line

Iostat

Format: iostat [Options] [< time interval > [< times >]]

Example:

Iostat-d

Iostat-d 2 2

Iostat-x 1 2

Netstat

To pay special attention to the number of "established", if the more established, the more connections established, if always high, then it is necessary to pay attention, because the system to open the number of connections is limited.

Common Applications :

1. View the IP with the highest number of connections

grep awk ' {print $} ' awk ' {print $} ' Sort Uniq -C

2. Count the number of connections in different states of TCP

awk ' /^tcp/{++s[$NF]} END {for (a in S) print A, S[a]} '

Df-h

View file system disk space usage

Du-sh

View (calculate) file size

I can do that.

Du--max-depth=2--block-size=m

Or

ll--block-size=m

Other related

Maximum number of Linux system open files limit

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.