8个用来监控Linux性能的最佳命令行工具
1. Top Command
Linux ‘Top Command’ is an advanced performance monitoring tool, which is popularly used amongst the Linux system administrators. It is available for majority of Linux and Unix operating systems. Top Command is used to display the active real-time processes in a structured list and the updates instantly when new processes are getting active. It also shows the memory usage, CPU usage, swap memory, buffer size, cache size, process PID, users, and commands etc.
2. LSOF – List Open Files
Lsof command is workable in all Linux and Unix systems, which can display all open files and running processes. Open files mean the disk files, network sockets, devices, and pipes. By seeing the command line, you can easily identify which files are open or in use. You can take necessary actions at the right issue than spending time to identify the trouble.
3. VmStat – Virtual Memory Statistics
VmStat Linux command is used to display all the statistics related to the virtual memory, disks, kernels, I/O blocks, system processes, process interrupts, CPU activities etc. The VmStat command tool is not directly available under the Linux systems, but you have to install an additional package called as SysStat, which consist of VmStat program.
4. Tcpdump – Network Packet Analyzer
Tcpdump is another popularly used command line network packet motoring program or otherwise called the ‘packet sniffer’. This tool is used to filter or capture the TCP/IP packets, which are transferred through or received on any specific interface, which is a part of the network. Tcpdump also offers the option to save the captured packets in any particular file for doing the analysis later. This tool is available for almost all major Linux and Unix distributions.
5. HTop – Linux Process Monitoring
HTop is a highly functional real-time Linux monitoring tool, which is very interactive for easy usage. HTop is almost similar to the Linux Top command, which we discussed earlier, but it has got stronger features and a very easy to manage interface, many short-cut keys, horizontal and vertical view of the processes and many more. HTop is not included by default in the Linux systems, but it is a third party tool, which needs to be installed using the YUM package management tool.
6. NetStat – Network Statistics
NetStat is another command line tool for Linux system monitoring, which is used to closely monitor the incoming and outgoing network packets and display the statistics. It also shows the interface statistics. NetStat is a highly functional tool for any system administrators in terms of monitoring the network performance and identify any problems instantly to troubleshoot them easily.
7. IPTraf –IP LAN Traffic Monitoring
IPTraf is a console-based open source IP LAN network monitoring tool. It works by collecting all the needed information related to the IP traffic, which gets through the monitored network including the TCP flag information, TCP/UDP breakdowns, ICMP details, TCP connection packet as well as byne counts. It also collects the statistics of UDP, TCP, IP, non-IP, IP checksum errors, ICMP, interface activity and more.
8. Iotop –Linux Disk I/O Monitor
Iotop is somewhat similar to the Htop and Linux Top Command programs, but it has an added accounting feature to track and display the real-time Linux disk I/O and the active processes. This featured tool is found very useful in identifying the exact processes and the high usage of disk write/read of the process.
Apart from the top eight mentioned above, you can also find more tools for Linux monitoring. However, rather than fully going by the reviews and comments, it is highly recommended that you try out with a trial usage of these and find out which one best suits your need and offers you better comfort.