31 Best Linux Performance Monitoring Tools

Linux Performance Monitoring tools are the tools that allow you to keep track of your Linux system's resources and storage usage, as well as the state of your network. The tools can be used to troubleshoot and debug Linux System Performance issues.

In this tutorial, we will learn the best tools for Linux performance monitoring and troubleshooting.

1. Top - Process Monitoring

The top command is a performance monitoring program used to monitor processes and system resource usage in Linux. It can displays CPU usage, Memory Usage, Swap memory, Cache size, Buffer size, Process PID, User, commands, and other information. The top command is more often used by system administrators for performance monitoring in Linux/Unix-like operating systems.

To list all running Linux Processes, type: 

$ top
Top - Process Monitoring

2. Vmstat – Virtual Memory Statistics

vmstat is a system monitoring tool to collect and displays the statistics of processes, memory, paging, block IO, traps, disks, and CPU activity.

The vmstat command is not available by default in the Linux system. However, you can install vmstat in your machine using the following command.

On Debian/Ubuntu and Mint
$ sudo apt-get install sysstat     

On CentOS/RHEL/Fedora/Rocky Linux and AlmaLinux
$ sudo dnf install sysstat

On Older CentOS/RHEL & Fedora
$ sudo yum install sysstat

On Arch Linux
$ sudo pacman -S sysstat

To display statistics of the virtual memory use the following command:

$ sudo vmstat
 Vmstat – Virtual Memory Statistics

3. Iostat – Input/Output Statistics

Iostat is a system monitor tool to collect and display input/output storage device statistics. This tool can be used to troubleshoot storage device (local disk, remote disks over network such NFS) performance issues.

The iostat package must be installed in your system to use the iostat command. You can install the package using the following command.

On Debian/Ubuntu and Mint
$ sudo apt-get install sysstat     

On CentOS/RHEL/Fedora/Rocky Linux and AlmaLinux
$ sudo dnf install sysstat

On Older CentOS/RHEL & Fedora
$ sudo yum install sysstat

On Arch Linux
$ sudo pacman -S sysstat

To displays CPU and I/O statistics of all partitions use iostat without any options:

$ sudo iostat
Iostat – Input/Output Statistics

4. Iotop – Linux Input/Output Disk Monitoring

The iotop command monitors Disk Input/output usage information using the Linux Kernel. It displays the real-time I/O usage sorted by processes or threads on the server.

The iotop command is not available in the Linux system by default. However, you can install iotop on your machine using the following command.

On Debian/Ubuntu and Mint
$ sudo apt-get install iotop     

On CentOS/RHEL/Fedora/Rocky Linux and AlmaLinux
$ sudo dnf install iotop

On Older CentOS/RHEL & Fedora
$ sudo yum install iotop

On Arch Linux
$ sudo pacman -S iotop

To display the disk input/output usage, type:

$ sudo iotop
Iotop – Linux Input/Output Disk Monitoring

5. Htop – Process Monitoring

Htop is a cross-platform interactive system monitor and process viewer. It allows shortcut keys, vertical and horizontal views of the process, uses color to provide resource-usage statistics, and many more.

Simply run htop from the terminal to display full list of running processes.

$ sudo htop
Htop – Process Monitoring

6. Free – Display Linux Server Memory Usage

The free command displays the total amount of free and used physical (RAM). It also shows the swap memory, as well as the buffers used by the kernel.

Use the following command to display the Linux memory usage:

$ free 
free command

7. Uptime – Linux Running Time

The uptime command is used to find how long the Linux system has been running. It displays information such as the current time, the number of users that are currently logged in, and the system load averages for the last 1, 5, and 15 minutes and the total time the system is running.

To display the Linux running time, type:

$ uptime
uptime command

8. SAR – Report Linux Activity

System Activity Report (SAR) is a real-time system monitoring tool. Aside from real-time system monitoring, SAR may also gather performance data in the background on an ongoing basis and analyze it to look for bottlenecking issues.

The SAR package is not found by default in the Linux system, but you can install the Sysstat package as SAR is part of sysstat. You can install the package using the following command.

On Debian/Ubuntu and Mint
$ sudo apt-get install sysstat     

On CentOS/RHEL/Fedora/Rocky Linux and AlmaLinux
$ sudo dnf install sysstat

On Older CentOS/RHEL & Fedora
$ sudo yum install sysstat

On Arch Linux
$ sudo pacman -S sysstat

Use -A option along with sar command to display detailed information about the I/O Devices, CPU, Memory, and Network statistics.

$ sar -A

To display I/O device status, use the '-d' option along with sar command. Similarly, to display CPU average load, use the '-q' option with sar command. To display the swap status, use the '-S- command along with sar command.

To display the network counter using sar, use the following command.

$ sar -n dev 
sar - network statistics

9. Tcpdump – Network packet analyzer

tcpdump is a command-line network packet analyzer that is used to capture packets that are received and sent over a network. It works on Linux and UNIX-type operating systems.

The following command displays the captured packets on the interface eth0:

$ sudo tcpdump -i eth0
tcpdump

10. ss – Network Statistics

The socket statistics (ss) command is used to display information about the network socket in Linux.  It can display stats for PACKET, TCP, UDP, DCCP, RAW, and Unix domain sockets. The ss command is a modern replacement for netstat command.

To display all TCP sockets on Linux, use the following command.

$ ss -at
ss - TCP Network Statistics

To display all UDP sockets on Linux, use the following command.

$ ss -au
ss - UDP Network Statistics

11. Lsof – List Open Files

lsof command is used to display the list of open files and the processes. The lsof stands for 'List Open Files'. The open files include network connections, devices, and directories.

Simply run lsof command to display all the files opened by any process in the Linux/Unix system.

$ lsof
lsof command

You can use lsof command with specific options to display information as per your requirement.

12. ip command - Display interface and routing

IP (Internet Protocol) command is used to configure network interfaces. It can display, modify network interfaces and routes.

To display IP routing-table use the following command.

$ ip route
ip route command

13. ps command - Displays Currently Running Processes

The ps command is primarily used to find out what processes are running on your system, however, it can give you additional information about the running processes to troubleshoot.

To display all the running processes, use the following command.

$ ps -A

or

$ ps -e
ps command

14. mpstat - Display processor related statistics

mpstat command is used to display processor-related statistics. It shows reports for each available processor, starting with processor 0.

To display all information about CPU that mpstat can display, type

$ mpstat -A
mpstat command

15. pmap - Display the memory map of a process

The pmap command is used to display the memory map of a process. You need to add PID along with pmap command to display the memory map of the given process.

To display the memory map of process ID, use the following command.

$ pmap -d 1694
pmap command

16. Monit - Process supervision tool

Monit is a free open-source utility for proactively monitoring and managing system processes, applications, files, directories, and filesystems. It also monitors services like Apache, MySQL, Mail, FTP, Nginx, SSH, and so on. This program can restart the failed services, and the app can send an alert email including the fault details so that urgent action may be taken.

You may see the system status via the command line or HTTP web server. For Ubuntu users, use the following command to install Monit.

$ sudo apt install monit

17. Munin - Network resource monitoring tool

Munin is an open-source web-based network monitoring program. It is compatible with all Unix-like operating systems, and there are 500 different plugins available to monitor your system as needed. It contains a feature that allows it to send notifications to the appropriate authorities when there is a problem or when the error has been resolved.

18. Collectl - Performance monitoring tool

Collectl is a command-line performance monitoring tool to gather information on system resources such as CPU usage, disk, memory, network, and more.

To install collectl in your system, use the following command.

On Debian/Ubuntu and Mint
$ sudo apt-get install collectl -y     

On CentOS/RHEL/Fedora/Rocky Linux and AlmaLinux
$ sudo dnf install collectl

On Older CentOS/RHEL & Fedora
$ sudo yum install collectl

On Arch Linux
$ sudo pacman -S collectl

To display the CPU usage, disk, and networks, in short, use the following command.

$ collectl
collectl command

19. Zabbix - Monitoring software

Zabbix is an enterprise-level opensource monitoring software to monitor the real-time track of networks, servers, and applications. It can check standard networking services such as HTTP, FTP, SMTP, and so on.

Zabbix collects metrics from systems using Zabbix agent, SNMP and IPMI agents. The web interface provides network maps, slideshows, and drill-down reports, etc. Zabbix can notify when an event occurs via different channels. It uses strong data protection using encryption between components, user permissions, and authentication methods.

20. cacti - Web-based network monitoring and graphing tool

Cacti is an open-source web-based network monitoring and graphing tool based on data logging tool RRDtool. It is commonly used to graph time-series data of metrics such as CPU load and network bandwidth.

To use cacti needs a web server either Nginx or Apache, PHP, and MySQL or MariaDB database.

21. Nagios - Monitoring system

Nagios is an open-source monitoring system that runs on Linux operating system and monitors devices running on Windows, Linux, and Unix systems. It provides a centralized view of infrastructure using the web interface.

Nagios periodically checks parameters and sends alert notifications based on the thresholds. You may also define warning and critical threshold levels for certain services to assist you to deal with the problem more quickly.

22. Stacer - Linux application monitor and system optimizer

Stacer is an open-source all-in-one utility to monitor applications and optimize systems. It can display displays the last 60 seconds of CPU, RAM, Disk, CPU Load Average, and network activity. On the interface, it allows sorting processes based on PID, CPU, and memory usage.

To install Stacer in Ubuntu, follow the following command.

$ sudo add-apt-repository ppa:oguzhaninan/stacer -y
$ sudo apt-get update 
$ sudo apt-get install stacer -y

23. iptraf - IP Network Monitoring Software

IPTraf is an open-source real-time network monitoring software with a console interface. It is used to gather information such as IP traffic monitor that flows across the network. TCP flag information, ICMP data, TCP/UDP traffic address, and so on are all included. It also collects data from TCP, UDP, IP, ICMP, non-IP, and other protocols.

Simply run iptraf from the terminal to open the menu to configure and display statistics.

$ iptraf
iptraf - IP Network Monitoring Software

24. atop - ASCII full-screen performance monitor

atop is an ASCII full-screen performance tool to monitor the activities of all processes. On a process level, it displays which processes are responsible for the stated CPU and memory load.

To display the CPU, memory, disk, and network performance, use the following command.

$ atop
atop - ASCII full-screen performance monitor

25. iftop - Linux network analyzing tool

iftop is a terminal-based Linux network bandwidth monitoring tool. It can display network activities on an interface.

By default, iftop shows bandwidth usage of the default interface.

$ sudo iftop
 iftop - Linux network analyzing tool

26. glances - Real time system monitoring tool

Glances is a cross-platform monitoring application that can function in client/server mode and offers a lot of information on a small screen.

Glance can monitor CPU, load average, memory, network interfaces, Disk I/O, processes, and file system spaces utilization.

glances without any options display the real-time system information:

$ glances
glances - cross-platform monitoring tool

27. Strace - system call tracer for Linux

strace is a system call tracer for Linux that is used for debugging and troubleshooting programs in Linux. The strace command displays the system calls by the process and the signals received by the process.

Simply run strace with a commnad, here we tracing of all system calls made by the ls command.

$ strace ls 
Strace - system call tracer for Linux

28. nmon - Performance monitoring tool

nmon (Nigel's Performace Monitor) command line is a performance system monitoring tool. It can monitor system resources include CPU, memory, Disk Usage, Network, Top processes, NFS, Kernel, and many more.

To open simply type nmon and on the page toggle the statistics you want to view

$ nmon
nmon - Performance monitoring command-line tool

29. Sysdig - Advanced view of system processes

Sysdig is an open-source monitoring tool used to troubleshoot, analyze, explore a system. The sysdig enables you to capture, save, filter, and examine the behavior of the Linux System.

The sysdig command without any arguments displays your Linux System events.

$ sudo sysdig

The output displayed is too long, so you can use less (|) option along with sysdig to display less output.

$ sudo sysdig | less
sysdig command

30. Psacct or acct – Monitoring User Activity

psacct or acct is an opensource tool used for monitoring a users’ activity on the system. It displays information such as commands issued by the user, resources used, the time the user was active on a system, and so on.

The following are few commands used to display the user’s activity.

Display Statistics of users Connect time 
$ sudo ac

Display Statistics of users Day-wise
$ sudo ac -d

Display Time Totals for each User
$ sudo ac -p

Display Individual User Time
$ sudo ac [Username]
acct – Monitoring User Activity

31. NetHogs – Process Network Bandwidth Monitoring

NetHogs is a command-line tool like Linux top command used to monitor network traffic. It can keep track of network bandwidth by the process in real-time.

Simply run nethogs command is used to display the network bandwidth.

$ sudo nethogs
nethogs command

Coclusion

In this tutorial, we learned the best tools to monitor Linux performance. Thanks for reading, provide your feedback and suggestions in the comment section.

Leave a Comment