Monitoring System Resources (CPU, RAM, Disk)

Ubuntu: Monitoring System Resources (CPU, RAM, Disk)

Monitoring system resources helps ensure your server is running efficiently and prevents downtime. This guide explains how to check CPU, RAM, and disk usage on Ubuntu servers.


Step 1: Check CPU Usage

top

Displays real-time CPU usage and running processes.

htop

Provides a more user-friendly view (install with sudo apt install htop -y).


Step 2: Check RAM Usage

free -m

Shows memory usage in MB.

vmstat

Displays memory, CPU, and process statistics.


Step 3: Check Disk Usage

df -h

Shows disk usage in human-readable format.

du -sh /var/log

Displays the size of a specific directory (e.g., logs).


Step 4: Check I/O Performance

iostat

Displays CPU and disk I/O statistics (install with sudo apt install sysstat -y).


Step 5: Monitor Processes

ps aux

Lists all running processes with resource usage.


Step 6: Real-Time Monitoring Tools

glances

Install with sudo apt install glances -y for a comprehensive system monitoring tool.


Best Practices

  • Regularly monitor CPU, RAM, and disk usage to prevent overload
  • Set up alerts with monitoring tools (Netdata, Prometheus, Nagios)
  • Investigate high resource usage immediately to avoid downtime
  • Clean up logs and unused files to free disk space

Note: HostPalace servers are optimized for performance, but monitoring resources ensures smooth operation and helps identify issues early.