In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how the Linux system to check the network and IO performance, the editor feels very practical, so share with you to learn, I hope you can learn something after reading this article, say no more, follow the editor to have a look.
In Linux systems, you can use iftop to view network usage, and iotop to view disk io usage.
Use iftop on Linux to view network usage, and iotop to view disk io usage
First, you need to install iftop and iotop:
Yum install iftop
Yum install iotop
= =
Instructions for using iftop:
After the installation is complete, use the iftop-n command to view the usage of the network:
After uploading a large file, you can see the network usage:
To track which process is occupying the network, you can use the following command:
Netstat-antop | grep 106.120.78.190
If more than one connection exists for the corresponding IP, the following result may appear (you can match the column name above):
! [Machine generated alternative text:root@OanCentOS65 netstat-antop Active Internet connections (servers Proto Recv-Q Send-Q Local Address and established) Fo reign Address State PID/Proq ram name Timer! [Machine generated alternative text:root@DanCentOS65 netstat 1 "6.12" 78.19 "- antop 192.168." 4.22 "168." 4.22 "168." 4.22 192.168. "4.22 g rep tcp tcp tcp tcp 52 1" 6.12 ".78. 19': 47812 ESTABLISHED 38 '39/sshd ESTABLISHED 37973/sshd ESTABLISHED 37791/sshd ESTABLISHED 37855/sshd keepalive (6885. Keepalive (5422 keepalive (5549
The meaning of netstat parameter:
-a (all) shows all options, but does not show LISTEN correlation by default
-t (tcp) displays only tcp related options
-u (udp) shows only udp related options
-n refuses to display aliases and can show that all numbers are converted into numbers.
-l lists only the status of services in Listen (monitoring)
-p displays the name of the program that established the relevant link
-r displays routing information, routing table
-e displays extended information, such as uid, etc.
-s statistics based on each protocol
-c execute the netstat command at regular intervals.
The first column "2880" is the receiving queue. If there is a large backlog of this queue for one of the connections, it means the heavy traffic generated by this link. Further comparing with the column PID, you can find that the corresponding PID is 37973, and then use the ps command to view the details of the process:
! [Machine generated alternative text: [root@Dancent0S65 06:34 root root ps 38 "39". "2 38506". "aux I grep 38639 39" 8? 1 "33" 8 82 "pts/3 sshd: daniel privl ep 38" 39
Ps parameter description:
-a displays the processes executed under all terminals, except for the phase job leader.
A displays all processes under the current terminal, including those of other users.
-A shows all processes.
-c displays the CLS and PRI fields.
C when listing processes, displays the real instruction name of each process, without the identification of paths, parameters, or resident services.
-C specifies the name of the execution instruction and lists the status of the process in which the instruction is executed.
-d shows all processes, excluding those of phase operation leaders.
-e this parameter has the same effect as specifying the "A" parameter.
E when listing processes, displays the environment variables used by each process.
-f displays the UID,PPIP,C and STIME fields.
F displays the tree structure with ASCII characters to express the relationship between processes.
-g the effect of this parameter is the same as that of specifying the "- G" parameter, and can also be specified using the name of the phase operation leader.
G shows all processes under the current terminal, including those of group leaders.
-G lists the status of the processes that belong to the group, or you can specify it using the group name.
H does not display the title column.
-H displays a tree structure, indicating the interrelationships between processes.
-j or j displays the status of the process in a work-controlled format.
-l or l displays the status of the process in a detailed format.
L lists the relevant information about the field.
-m or m displays all threads.
N represents the USER and WCHAN fields with numbers.
-N displays all processes except those under the terminal that execute ps instructions.
-p specifies the process identifier and lists the status of the process.
P this parameter has the same effect as specifying the "- p" parameter, except for a slight difference in the list format.
R lists only the processes that are being executed by the current terminal.
-s specifies the process identifier of the phase job and lists the status of the processes belonging to the phase job.
S displays the status of the process in the format of process signals.
S lists processes, including interrupted child process information.
-t specifies the terminal number and lists the status of the processes that belong to the terminal.
The effect of this parameter is the same as that of specifying the "- t" parameter, except for a slight difference in list format.
-T displays all processes under the current terminal.
-u this parameter has the same effect as specifying the "- U" parameter.
U displays the process status in a user-based format.
-U lists the status of the processes that belong to the user, or you can specify it using the user name.
U lists the status of the processes that belong to the user.
V displays the process status in the format of virtual memory.
-V or V displays version information.
-w or w shows the status of the process in a broad format.
X displays all processes, not distinguished by terminals.
X uses the old Linux i386 login format to show the progress.
When-y is used with the parameter "- l", the F (flag) field is not displayed, and the ADDR field is replaced by the RSS field.
-the effect of this parameter is the same as specifying the "p" parameter.
Cols sets the maximum number of characters per column.
Columns this parameter has the same effect as specifying the "- cols" parameter.
Cumulative this parameter has the same effect as specifying the "S" parameter.
Deselect this parameter has the same effect as specifying the "- N" parameter.
Forest this parameter has the same effect as specifying the "f" parameter.
Headers repeats the title column.
Help online help.
Info displays troubleshooting information.
Lines sets the number of columns in the display screen.
No-headers this parameter has the same effect as specifying the "h" parameter, with only slight differences in list format.
Group this parameter has the same effect as specifying the "- G" parameter.
Group this parameter has the same effect as specifying the "- G" parameter.
Pid this parameter has the same effect as specifying the "- p" parameter.
Rows this parameter has the same effect as specifying the "- lines" parameter.
Sid this parameter has the same effect as specifying the "- s" parameter.
Tty this parameter has the same effect as specifying the "- t" parameter.
User this parameter has the same effect as specifying the "- U" parameter.
User this parameter has the same effect as specifying the "- U" parameter.
Version this parameter has the same effect as specifying the "- V" parameter.
Widty this parameter has the same effect 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: occupied cpu utilization
VSZ: memory usage occupied
RSS: amount of virtual memory consumed
TTY: whether the program is executed for logins, tty1-tty6, local logins, and remote logins if pts/??,.
STAT: status of the program, R: in progress, S: sleep, T: detecting or stopping, Z: death program
START: program start time
TIME: the time for the program to run
COMMAND: the instruction executed.
= =
Instructions for using iotop:
First use the command iotop to view the information:
Press the p key in this interface to change the TID to PID, and press the o key to display the currently active instead of all the processes:
You can check the corresponding process according to PID:
! [Machine generated alternative text: root@Dancent0S65 GRV 24 "root root ps 25" 3912 ".6" 39124 "." aux I grep 39126 1 "31" 4852 pts/2 1 "33" 8 82 "pts/4 rz-e": "grep 3912"
This is how the Linux system looks at the network and IO performance. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.