In Linux, there are many tools available for performance analysis and monitoring. In this article, we will introduce 6 of the most commonly used tools.
top – display cpu memory process info in Linux
The top command is one of the most commonly used tools in Linux for monitoring system performance.
By default, it displays information about the cpu usage, memory, and processes. This information can be helpful in understanding what is causing a system to sluggish or unresponsive.
The top command also provides options for sorting and filtering the information displayed. For example, the -p option can be used to only display information about a specific process.
Overall, the top command is a powerful tool that can be used to troubleshoot performance issues on a Linux system.
iostat – monitor disk IOPS bandwidth in Linux
iostat is a command line utility that allows users to monitor input/output activity on their hard drives.
It can be used to check the overall health of a hard drive, as well as to diagnose specific problems.
iostat can be run on any Unix-like operating system, and is included in most Linux distributions.
The utility provides detailed information about the read and write speed of a hard drive, as well as the number of I/O operations that have been performed.
This information can be useful in troubleshooting slow performance or high latency issues.
Additionally, iostat can be used to monitor the utilization of specific disks or partitions.
This can be helpful in identifying which disks are being heavily utilized, and which ones may be underutilized. Overall, iostat is a powerful tool that can be used to monitor and optimize hard drive performance.
mpstat – monitor processor activity in Linux
The mpstat command is a powerful tool that can be used to monitor processor activity on a Linux system.
By default, mpstat will show statistics for all processors on the system. However, it can also be configured to show statistics for a specific processor or processors.
Additionally, mpstat can be used to generate a report that includes historical data. This can be useful for troubleshooting performance issues or identifying trends.
Overall, the mpstat command is a valuable resource for anyone who needs to monitor processor activity on a Linux system.
sar – view system statistics on Linux
The sar command in Linux is a powerful tool that can be used to monitor system activity. The command can be used to view statistics on CPU usage, memory usage, disk activity, network traffic, and more.
Additionally, the sar command can be used to generate reports on system activity over time. This makes it an invaluable tool for system administrators who need to troubleshoot performance issues or track trends in system usage.
While the sar command has a wide range of options, its basic syntax is relatively simple. For example, the following command will display statistics on CPU usage for the past hour: sar -u 1. With a few keystrokes, the sar command can provide a wealth of information about Linux systems.
iotop – monitor disk iops per process in Linux
The iotop command is a simple yet powerful utility that allows users to monitor disk I/O usage per process in real time.
By default, iotop will show all processes that are currently active in terms of I/O activity, sorted by the amount of I/O bandwidth that each process is using. However, iotop also supports a number of useful options that can be used to customize the output.
For example, the -p option can be used to specify a particular pid to monitor, and the -t option can be used to show only processes that are currently using a significant amount of I/O bandwidth.
In addition, iotop also supports filtering by process name and user id. Overall, the iotop command is an extremely useful tool for any Linux user who wants to monitor and troubleshoot disk I/O issues.
nethogs – monitor network traffic per process in Linux
NetHogs is a Linux utility that allows you to monitor network traffic and bandwidth usage in real time.
It can be useful for tracking down rogue applications that are consuming excessive amounts of bandwidth or for simply keeping an eye on your overall network usage. NetHogs is open source and available for free.
It works by sniffing traffic on all active network interfaces and then displays a running total of data sent and received by each application. This information is updated every second, making it easy to see which applications are using the most bandwidth at any given moment.
NetHogs is also capable of displaying detailed information about each individual connection, such as the hostname, IP address, and port number. This can be helpful for troubleshooting network problems or for identifying potential security risks.