Master the ‘w’ Command: Real‑Time System Load and User Monitoring
The Linux ‘w’ command provides a richer view of system load than ‘uptime’, displaying average load over 1, 5, and 15 minutes, detailed information about logged‑in users, their CPU usage, current activity, and offers guidelines for interpreting load values on single‑ or multi‑CPU systems.
The w command, similar to uptime, shows system load but also provides detailed information about currently logged‑in users.
The first line mirrors uptime, displaying the 1‑, 5‑, and 15‑minute load averages, which represent the average number of processes in the run queue during those intervals.
Subsequent lines list each logged‑in user with fields such as:
JCPU : CPU time consumed by the user's terminal since the last program was started.
WHAT : The command or activity the user is currently performing.
PCPU : CPU time used by the process indicated by WHAT.
Linux calculates the load average every five seconds, counting running tasks and tasks waiting for disk I/O, then aggregates these counts into 1‑, 5‑, and 15‑minute averages. On multi‑CPU systems, the load for each CPU is summed.
To assess whether the load is healthy, compare the load average to the number of CPUs. Common thresholds per CPU are:
≈1 – attention needed; investigate when convenient.
≈3 – urgent; prioritize troubleshooting.
≈5 – critical; immediate action required to prevent server failure.
For a server with multiple CPUs, divide the reported load by the CPU count before applying these thresholds.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java High-Performance Architecture
Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
