• About Us
  • Disclaimer
  • Indeks
Kebumen Update
No Result
View All Result
  • Web Hosting and Server Management
  • Monitoring & Maintenance
  • Security & Hardening
  • Panels & Tools
  • Cloud & DevOps
  • Tech
  • Web Hosting and Server Management
  • Monitoring & Maintenance
  • Security & Hardening
  • Panels & Tools
  • Cloud & DevOps
  • Tech
No Result
View All Result
Kebumen Update
No Result
View All Result
Home Monitoring & Maintenance

How to Check CPU, RAM, and Disk Usage on Linux Servers

awbsmed by awbsmed
April 12, 2025
in Monitoring & Maintenance
0
RAM & CPU Usage PHP Script | Server Health Check – JamesBachini.com
ADVERTISEMENT

 

Monitoring your Linux server’s performance is crucial for maintaining system health and ensuring optimal operation. By keeping an eye on CPU, RAM, and disk usage, you can proactively address potential issues before they escalate. This comprehensive guide will walk you through various command-line tools and techniques to effectively monitor these critical system resources.

READ ALSO

Automated Backups for Your Server with Rsync & Cron

How to Set Up Cron Jobs for Server Automation


A. Understanding System Resource Monitoring

Before diving into specific tools, it’s essential to understand why monitoring CPU, RAM, and disk usage is vital:

ADVERTISEMENT

A. CPU Usage: High CPU usage can indicate processes consuming excessive processing power, leading to system slowdowns.

B. RAM Usage: Monitoring memory usage helps identify memory leaks or applications consuming more memory than expected.

C. Disk Usage: Keeping track of disk space ensures that your system doesn’t run out of storage, which can cause applications to fail or data loss.


B. Monitoring CPU Usage

Several tools can help you monitor CPU usage in real-time:

1. top

The top command provides a dynamic, real-time view of the running system. It displays system summary information and a list of tasks currently managed by the Linux kernel.

bash
top

Within top, you can sort processes by CPU usage by pressing the %CPU column header.

2. htop

htop is an interactive process viewer, which is a more user-friendly alternative to top. It provides a color-coded display and allows for easier process management.

bash
htop

Use arrow keys to navigate and function keys to manage processes.

3. mpstat

The mpstat command, part of the sysstat package, provides CPU usage statistics.

bash
mpstat -P ALL 1

This command displays CPU usage for all processors every second.

4. iostat

iostat reports CPU statistics and input/output statistics for devices and partitions.

bash
iostat -c 1

This command provides CPU usage statistics every second.

5. nmon

nmon (Nigel’s Monitor) is a performance monitoring tool that provides CPU, memory, disk, and network usage statistics.

bash
nmon

Press c to view CPU usage.


FIX: CPU not showing all cores in Task Manager

C. Monitoring RAM Usage

Monitoring memory usage helps ensure that your applications have enough memory to function correctly.

1. free

The free command displays the total amount of free and used physical and swap memory.

bash
free -h

The -h flag displays the output in a human-readable format.

2. vmstat

vmstat reports information about processes, memory, paging, block IO, traps, and CPU activity.

bash
vmstat 1

This command updates the information every second.

3. smem

smem provides a report of memory usage per process, including shared memory.

bash
smem

This tool helps identify processes consuming significant memory.

4. ps_mem

ps_mem is a Python script that accurately reports memory usage per program.

bash
sudo ps_mem

This command provides a summary of memory usage by program.


How Many CPU Cores Do You Need? [2024 Guide] - CPU Ninja

D. Monitoring Disk Usage

Keeping track of disk usage ensures that your system has enough space for applications and data.

1. df

The df command reports the amount of disk space used and available on file systems.

bash
df -h

The -h flag displays the output in a human-readable format.

2. du

du estimates file space usage.

bash
du -sh /path/to/directory

This command shows the total size of a directory.

3. iostat

As mentioned earlier, iostat also provides disk I/O statistics.

bash
iostat -d 1

This command displays device utilization statistics every second.

4. iotop

iotop monitors disk I/O usage by processes.

bash
sudo iotop

This command requires root privileges.

5. dstat

dstat provides real-time system resource statistics, including disk usage.

bash
dstat -d

This command displays disk read/write statistics.


E. Combining Tools for Comprehensive Monitoring

For a holistic view of your system’s performance, consider combining multiple tools:

A. Glances: A cross-platform monitoring tool that presents a summary of system resources.

bash
glances

B. Netdata: A real-time monitoring tool that provides web-based dashboards.

bash
bash <(curl -Ss https://my-netdata.io/kickstart.sh)

C. Conky: A lightweight system monitor that displays information on your desktop.

bash
conky

F. Automating Monitoring with Scripts

Automate monitoring tasks by creating scripts that run at regular intervals:

bash
#!/bin/bash
date >> /var/log/system_monitor.log
top -b -n1 | head -n 10 >> /var/log/system_monitor.log
free -h >> /var/log/system_monitor.log
df -h >> /var/log/system_monitor.log
echo "------------------------------" >> /var/log/system_monitor.log

Schedule this script using cron:

bash
crontab -e

Add the following line to run the script every hour:

bash
0 * * * * /path/to/your/script.sh

Regularly monitoring CPU, RAM, and disk usage is essential for maintaining the health and performance of your Linux server. By utilizing the tools and techniques outlined in this guide, you can proactively identify and address potential issues, ensuring your system runs smoothly and efficiently.

Remember to tailor your monitoring strategy to your specific needs and continuously review and adjust your approach as your system evolves.

Tags: command-line toolsCPU usagedisk usageLinux monitoringRAM usageserver administrationsystem performance
ADVERTISEMENT

Related Posts

Backup and Restore Your Linux System with rsync - YouTube
Monitoring & Maintenance

Automated Backups for Your Server with Rsync & Cron

April 12, 2025
Automating Tasks in Linux with Cron Jobs
Monitoring & Maintenance

How to Set Up Cron Jobs for Server Automation

April 12, 2025
The 9 Best Server Monitoring Tools To Use in 2019
Monitoring & Maintenance

Top 5 Tools to Monitor Server Performance in Real-Time

April 12, 2025
Next Post
Backup and Restore Your Linux System with rsync - YouTube

Automated Backups for Your Server with Rsync & Cron

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Hybrid Cloud Reigns: The Smart IT Strategy

Hybrid Cloud Reigns: The Smart IT Strategy

by Salsabilla Yasmeen Yunanta
June 26, 2025
0

In the intricate landscape of modern enterprise IT, the concept of a singular, all-encompassing solution is increasingly a relic of...

NVMe Storage Transforms: The Data Speed Revolution

NVMe Storage Transforms: The Data Speed Revolution

by Salsabilla Yasmeen Yunanta
June 26, 2025
0

In the lightning-fast world of modern computing, where every millisecond counts, the storage subsystem has long been a bottleneck. Traditional...

Best Server Providers for 2025 - Server

Top Server Providers for 2025

by awbsmed
May 17, 2025
0

In the rapidly evolving digital landscape of 2025, selecting the right server provider is crucial for businesses and individuals alike....

Edge Computing Transforms Real-Time Data Processing

Edge Computing Transforms Real-Time Data Processing

by awbsmed
May 16, 2025
0

In an era defined by instantaneous insights and ultra‑low latencies, edge computing has emerged as a transformative force reshaping how...

Kebumen Update

KebumenUpdate.com diterbitkan oleh PT BUMI MEDIA PUBLISHING dengan sertifikat pendirian Kementerian Hukum dan Hak Asasi Manusia Republik Indonesia Nomor: AHU-012340.AH.01.30.Tahun 2022

  • About Us
  • Editor
  • Code of Ethics
  • Privacy Policy
  • Cyber Media Guidelines

Copyright © 2025 Kebumen Update. All Right Reserved

No Result
View All Result
  • Homepages
    • Home Page 1
    • Home Page 2
  • Tech

Copyright © 2025 Kebumen Update. All Right Reserved