Linux essential operation and maintenance utility, programmers cannot do without it

6 commonly used and more practical Linux tools can be used for environmental performance monitoring, and to help performance tuning, hope to help Linux operation and maintenance personnel.

 

TOP tools

top is one of the most commonly used Linux performance monitoring tools. The process and overall system performance can be monitored through the top tool.
Commands
Description
top
view of the overall system CPU, memory resource consumption
after top performing input 1 CPUcore resource usage view each
input top after performing F, P and select the option
process to see whether the scheduling thread execution to other Core the CPU
top -p $ PID -H
View the CPU resource usage of all threads in a process

 

Perf tools

The Perf tool is a very powerful Linux performance analysis tool, which can be used to obtain the in-process call status, resource consumption, and find and analyze hot functions.
Command
Description
perf top
View the hot functions in the current system perf sched record --sleep 1 -p $PID Record the system call of the process in ls perf sched latency --sort max View the results recorded in the previous step to schedule delay sorting

 

Numactl tools

The numactl tool can be used to view the NUMA node configuration and status of the current server, and the process can be bound to the specified CPU core through this tool, and the specified CPU core can run the corresponding process.
Command
Description
numactl -H View the NUMA configuration of the current server numactl -C 0-7 ./test Bind the application test to cores 0~7 Run numastat to
view the current NUMA running status

 

ethtool tool

Ethtool is a powerful network management tool under Linux. At present, almost all network card drivers have support for ethtool. It can be used to query network card status/drive version information, query sending and receiving data information and capability configuration, and network card working mode/ Query configuration such as link speed.
Command
Description
ethX
queries the basic settings of the ethx network port, where x is the number of the corresponding network card, such as eth0, eth1, etc. ethtool-k queries the offload information of the network card ethtool-K
modifies the offload information of the network card ethtool-c queries the aggregation information of the network card
ethtool-C modifies Network card aggregation information ethtool-l
View the number of network card queues
ethtool-L Set the number of network card queues

 

strace tool

strace is a program debugging tool under the Linux environment, used to track the system call of the application. Interpretation of the results of the execution of the strace command will print out all system calls in the calling order, including function names, parameter lists, and return values.
Command
Description
-T
displays the time consumed by each call
-tt
adds time information before each line in the output, microsecond level -p
tracks the specified thread ID

 

iostat tool

iostat is the most frequently used tool for investigating disk IO problems. It summarizes all online disk statistics and provides indicators for load characteristics summary, utilization rate and saturation. It can be executed by any user, and the statistical information comes directly from the kernel, so the overhead of this tool is basically negligible.
Command
Description
-c displays CPU usage -d
displays disk usage -k displays in KB units -m displays in M ​​units -p
displays the status of a single disk -t
displays timestamp -x displays detailed information

Guess you like

Origin blog.csdn.net/Python6886/article/details/112254270