As a system administrator, monitoring system resources and performance is an important task. By monitoring system resources and performance, you can identify performance bottlenecks, predict future resource needs, and troubleshoot issues as they arise. In this blog, we will explore how to monitor system resources and performance in Fedora using tools like top, htop, and sar.
Top
Top is a command-line tool that provides real-time information about system processes and their resource usage. It is a powerful utility that displays system statistics, including CPU usage, memory usage, and disk activity. To use top, open a terminal window and type “top” at the command prompt.
The top display is divided into several sections, each providing different information about system resources and performance. The first section displays a summary of system resources, including the total number of processes, CPU usage, memory usage, and swap space usage. The second section displays a list of processes, with information such as the process ID, user, CPU usage, memory usage, and the command that started the process.
To sort processes by CPU usage, press the “P” key. To sort by memory usage, press the “M” key. To quit top, press the “Q” key.
Htop
Htop is an enhanced version of top that provides more features and an improved user interface. Htop displays system statistics in real-time and allows users to interactively monitor system resources and performance. To use htop, open a terminal window and type “htop” at the command prompt.
The htop display is similar to top, but with additional features, such as color-coded resource usage, scrollable process lists, and the ability to filter processes by name or user. To sort processes by CPU usage, press the “F6” key and select “CPU.” To sort by memory usage, press the “F6” key and select “MEM.” To quit htop, press the “Q” key.
Sar
Sar (System Activity Reporter) is a command-line utility that collects system performance data and generates reports. Sar can be used to monitor CPU usage, memory usage, disk activity, network activity, and other system resources. To use sar, open a terminal window and type “sar” at the command prompt.
By default, sar collects data every 10 minutes and stores it in log files. To view system performance data for a specific time period, use the “-s” and “-e” options followed by the start and end times in HH:MM:SS format. For example, to view system performance data for the last hour, type “sar -s 13:00:00 -e 14:00:00”.
Sar generates reports in plain text format, which can be viewed in a terminal window or saved to a file. Sar reports include system statistics such as CPU usage, memory usage, disk activity, and network activity, as well as information about individual processes.
Conclusion
Monitoring system resources and performance is an important task for system administrators. By using tools like top, htop, and sar, you can monitor system resources and performance in real-time and generate reports for analysis. These tools provide valuable information that can help you optimize system performance, troubleshoot issues, and plan for future resource needs.
How to create and manage backups and snapshots in Fedora Or How to configure and manage DNS services in Fedora with Bind