Linux View network and IO performance issues

Source: Internet
Author: User
Tags cpu usage

Use Iftop on Linux to view network usage, use Iotop to view disk IO usage

First you need to install Iftop and iotop:

Yum Install Iftop

Yum Install Iotop

=============================================================================================================== ====================

Iftop Instructions for use:

After the installation is complete, use the Iftop-n command to view the network usage:

After uploading a large file, you can see the network usage:

To track exactly which process is consuming the network, you can use the following command:

Netstat-antop |grep 106.120.78.190

If there are multiple connections to the corresponding IP, the following results may appear (you can do the above column name):

Netstat parameter meaning:

-A (All) displays all options and does not show listen related by default

-T (TCP) displays only TCP-related options

-U (UDP) displays only UDP-related options

-N refuses to display aliases, showing all numbers converted to numbers.

-l list only service status in Listen (listening)

-P Displays the program name that establishes the associated link

-R display routing information, routing table

-e display extended information, such as UID, etc.

-S statistics according to each protocol

-C executes the netstat command every other fixed time.

The first 2880 This column is the receive queue, if one of the connections this queue backlog, the description is the link generated large traffic, and further control of the PID column, you can find the corresponding PID of 37973, and then use the PS command to view the process details:

PS Parameter Description:

-A shows all the processes performed under all terminals except the stage job leader.

A shows all processes under the current terminal, including the processes of other users.

-a displays all processes.

-C Displays the CLS and PRI fields.

c when the process is listed, the actual instruction name of each process is displayed, not the path, parameter, or the identifier of the resident service.

-c< directive name > Specifies the name of the execution instruction and lists the status of the process for that instruction.

-D shows all processes, but does not include the process of the stage job leader.

-E The effect of this parameter is the same as specifying the "A" parameter.

e Displays the environment variables used by each process when the process is listed.

-F Displays Uid,ppip,c and Stime fields.

F Displays the tree structure with ASCII characters, and expresses the interrelationship between processes.

-g< Group name > The effect of this parameter is the same as specifying the "-G" parameter, which can also be specified using the name of the stage job leader.

G shows all processes under the current terminal, including the group leader process.

-g< Group ID > list The status of the process that belongs to the group, or you can use the group name to specify it.

H does not display the title column.

-h displays a tree structure that represents the interrelationships between processes.

-j or J Displays the status of the process in a work-controlled format.

-L or L use a detailed format to show the status of the process.

Information about the position of the column.

-M or m displays all threads.

n represents the user and Wchan fields as numbers.

-N Shows all processes in addition to the process under the PS command Terminal.

-p< Process Identification Code > Specifies the process identifier and lists the status of the process.

p< Process ID > The effect of this parameter is the same as specifying the "-P" parameter, only slightly different in the list format.

R lists only the processes currently in progress for the current terminal.

-s< Stage Job > Specifies the process identification code for the stage job, and lists the status of the process that is part of the stage job.

s uses the process signal format to display the status of the process.

S lists processes, including interrupted child process data.

-t< Terminal number > Specify the terminal number, and list the status of the process belonging to that terminal.

t< Terminal number > The effect of this parameter is the same as specifying the "-T" parameter, with only a slight difference in the format of the list.

-T displays all processes under the current terminal.

-u< User ID > The effect of this parameter is the same as specifying the "-u" parameter.

U Displays the status of the process in a user-oriented format.

-u< User ID > list The status of the process that belongs to the user, or you can specify it by using the user name.

u< User name > Lists the status of the process that belongs to the user.

V Displays the status of the process in the form of virtual memory.

-V or V displays version information.

-W or W uses a wide format to display the status of the process.

X shows all processes and is not differentiated by terminal.

X Displays the status of the process using the legacy Linux I386 login format.

The-y mate parameter "-L" does not display the F (Flag) field and replaces the addr field with the RSS field

-< Process ID > The effect of this parameter is the same as specifying the "P" parameter.

--cols< number of characters per column > sets the maximum number of characters per column.

--columns< the number of characters per column > The effect of this parameter is the same as specifying the "--cols" parameter.

--cumulative the effect of this parameter is the same as specifying the "S" parameter.

--deselect the effect of this parameter is the same as specifying the "-n" parameter.

--forest the effect of this parameter is the same as specifying the "F" parameter.

--headers the title column repeatedly.

--help online Help.

--info Displays the error message.

--lines< Display column Count > set the number of columns for the display screen.

--no-headers the effect of this parameter is the same as specifying the "h" parameter, with only a slight difference in the format of the list.

--group< Group name > This parameter has the same effect as specifying the "-G" parameter.

--group< Group ID > The effect of this parameter is the same as specifying the "-G" parameter.

--pid< Process ID > The effect of this parameter is the same as specifying the "-P" parameter.

--rows< Displays the number of columns > The effect of this parameter is the same as specifying the "--lines" parameter.

--sid< Stage Job > The effect of this parameter is the same as specifying the "-S" parameter.

--tty< Terminal number > The effect of this parameter is the same as specifying the "-T" parameter.

--user< User name > This parameter has the same effect as specifying the "-u" parameter.

--user< User ID > The effect of this parameter is the same as specifying the "-u" parameter.

--version the effect of this parameter is the same as specifying the "-V" parameter.

--widty< the number of characters per column > The effect of this parameter is the same as specifying the "-cols" parameter.

Common commands:

Ps-ef

PS aux

PS aux output format

USER PID%cpu%MEM VSZ RSS TTY statstart time COMMAND

User: Process Owner

Pid:pid

%CPU: CPU Usage consumed

VSZ: Memory usage consumed

RSS: The amount of virtual memory consumed

TTY: Whether the program executed for the login, if Tty1-tty6, is the native login, if the pts/??, is a remote login.

STAT: Status of the program, R: In progress, S: Sleep, T: detecting or stopping, Z: Death program

Start: Program start time

Time: When the program runs

Command: the command executed.

=============================================================================================================== ==========================

Iotop Instructions for use:

First use the command iotop to view the information:

Press the P key in this interface to change the TID to PID, and press O to display the current active instead of all the processes:

Depending on the PID, you can view the corresponding process:

Linux View network and IO performance issues

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.