Knowledgebase

Monitoring System Resources on Ubuntu 20.04 Print

  • monitoring, resources
  • 0

Monitoring system resources is an essential part of managing a server environment. It helps identify potential issues and bottlenecks, allowing for proactive troubleshooting and performance optimization. This guide introduces how to use various tools such as htop, vmstat, and iostat to monitor CPU, memory, disk I/O, and network usage on Ubuntu 20.04.

Step 1: Installing Required Packages

  1. Update the package lists for upgrades and new package installations:

    sudo apt update
  2. Install htop, sysstat (which contains vmstat and iostat), and net-tools:

    sudo apt install htop sysstat net-tools

Step 2: Monitoring CPU and Memory with htop

  1. Run htop in your terminal:

    htop

htop provides a real-time, color-coded overview of system usage. The top line displays CPU usage, the middle line shows memory usage, and the bottom line represents swap usage.

Step 3: Monitoring System Activity with vmstat

  1. Run vmstat in your terminal:

    vmstat

vmstat reports information about processes, memory, paging, block I/O, traps, and CPU activity.

To continuously monitor system activity, specify the time interval (in seconds) as an argument:

vmstat 5

Step 4: Monitoring Disk I/O with iostat

  1. Run iostat in your terminal:

    iostat

iostat reports CPU usage and I/O statistics for devices, partitions, and network filesystems.

Step 5: Monitoring Network Usage

To view network statistics, use the netstat command:

netstat -i

This command displays the status of the network interfaces on your system.

Conclusion:

Regular monitoring is vital in maintaining a healthy server and optimizing performance. By utilizing htop, vmstat, iostat, and netstat, you can ensure that you have an overview of your system resources at all times and can act quickly when issues arise.

Remember, these tools should form part of a broader monitoring strategy, which could include more comprehensive solutions for large-scale or mission-critical environments.


Was this answer helpful?
Back

Powered by WHMCompleteSolution