monitoring
Observing system state over time
-
free
Tested free examples: which column to read, why free memory is small on a healthy machine, units, swap and commit, and why a container sees its host.
-
journalctl
Tested journalctl examples: filtering by unit, priority and time, following logs live, output formats, and controlling journal disk usage.
-
ps
Tested ps examples: aux versus -ef, choosing columns with -o, selecting by user or name, sorting, the process tree, and pgrep instead of grep.
-
tail
Tested tail examples: -n and -c, the +N form that counts from the start, following a growing file with -f, and why log rotation needs -F instead.
-
top
Tested top examples: the summary lines, the process columns, sorting and filtering in batch mode, threads, and reading a process's memory and CPU.
-
Monitor a log file in real time
Watch a log file as new lines are written, filter it live, and keep watching across log rotation.
-
Why is this process using so much CPU?
The machine is slow and one process is at the top of top. Find it, check whether the figure means what it seems to, see what it is doing, and make it give way.
-
Why is this process using so much memory?
A process looks huge in top, or free shows almost nothing free. Check whether memory is really short, which of RSS, VSZ and PSS to believe, and how to limit it.