100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Linux & Shell Scripting
30 minbeginner

Resource Monitoring — top, ps, df

Resource monitoring is the practice of observing CPU, memory, disk, and network consumption to understand whether a system is operating within its capacity and to identify the source of performance problems. Every production incident involving slowness, unresponsiveness, or failure has a resource dimension — something is consuming too much CPU, memory has been exhausted, a disk is full, or a network interface is saturated. Diagnosing these conditions quickly requires fluency with Linux's monitoring tools.

The tools covered in this lesson — `ps`, `top`, `df`, `free`, `vmstat`, `iostat`, and `netstat`/`ss` — are available on every Linux system without additional installation. They are the first tools reached during a production incident precisely because they are always present, fast to invoke, and produce immediately actionable information. Prometheus, Grafana, and Datadog build their dashboards from the same underlying metrics these tools read.

This lesson organises monitoring by resource type — CPU, memory, disk, and network — and for each type covers both the snapshot tools (for immediate diagnosis) and the continuous tools (for trend observation). CricketPulse match-day scenarios provide the context: a spike in concurrent match viewers drives the CPU analysis, a memory leak in the score aggregator drives the memory analysis, and log file accumulation drives the disk analysis.

Analogy🏏Cricket
🏏 Think of it like cricket: The match itself is the kernel — real computation at the hardware level. The commentators translating that action into words for the audience are the shell: they take raw events and present them in a form humans can understand and interact with. The television set in your living room is the terminal emulator: it displays the commentary but does not participate in the match.Just as switching from one broadcaster to another changes commentary style but not the underlying match, switching between Linux distributions changes shell defaults and package manager but not the kernel. Just as Star Sports and Sony Six both cover the same IPL match with different graphics packages, Ubuntu and Alpine both run the same kernel with different userspace tools.The insight is that these layers are genuinely separate, which is why you can swap any one of them independently.
Lesson 11 of 40
0% complete