FreeBSD Fundamentals · Module 11 of 14

Monitoring, performance and resource evidence

Use top, vmstat, systat, procstat and system statistics to separate CPU, memory, I/O and process-level symptoms.

Learning objectives

By the end of this module, you should be able to:

  • Collect baseline resource evidence.
  • Connect a symptom to a likely subsystem.
  • Avoid tuning before measuring.

Start with system shape

top provides a quick process/system view. vmstat summarizes scheduler, memory and I/O activity. systat provides specialized interactive views.

Process detail matters

procstat exposes process files, arguments, memory maps and other kernel-visible details; sockstat connects processes to sockets.

Worked examples

See the idea in practice.

Collect a short snapshot

uptime
top -b -d 1 | head -25
vmstat 1 5
df -h
  • Use a small evidence bundle before changing tunables.
Hands-on lab

Lab — Build a five-minute health snapshot

Goal: Collect reproducible evidence for load, memory, disk usage and top processes.

Before you start

  • Any FreeBSD lab host.
STEP 1

Load and processes

uptime
top -b -d 1 | head -30
STEP 2

Memory and I/O

vmstat 1 5
STEP 3

Storage and sockets

df -h
sockstat -4 -6 | head -30

Verify

  • You have a timestamped baseline that can be compared after a change.

Expected outcome

  • The evidence separates resource domains instead of collapsing everything into load average.

If it fails

  • If top options differ on your release, consult man top and adapt without changing the diagnostic intent.
Real-world connection

Performance work should begin with measurements that can be repeated.

Avoid these traps

Common mistakes

  • Tuning sysctl values copied from the internet before measuring.
  • Treating load average as a CPU-percentage metric.
Knowledge check

Can you explain it without looking back?

Open each answer only after you have tried to answer the question yourself.

1What does vmstat help summarize?

Scheduler, memory and I/O activity over time.

2Why capture a baseline?

It gives you a comparison point for later changes and incidents.

3What does procstat add beyond ps?

Deeper kernel-visible details about a process such as files, arguments or memory mappings.

My Learning

Record your progress for this module.

Progress is saved in this browser immediately. When you sign in to My Learning, it can also sync across devices.

Not started

Attempt the core lab and knowledge checks before marking the module complete.