Unix OS Monitoring Tools

Most versions of Unix collect performance metrics once per second from the kernel, so most Unix performance monitoring facilities do not allow a sample rate of greater than once per second. You wouldn’t want to do much more monitoring of general statistics anyway, because the measurement itself would significantly add to the load. Read the manpage on each of these for more detailed information. Here are the major monitoring tools and some example output on a heavily loaded web server.

ps

The most basic tool to let you know what’s going on is ps, which displays all your processes along with information on CPU and memory usage. The options to ps vary a great deal with OS, so you need to read the ps manpage on your system for more details. An important point to remember is that Berkeley-style priorities are opposite from SVR4 priorities. In SVR4, higher numbers mean higher priority. You can display SVR4 priority with the -c option. Here’s a listing sorted by priority and edited a bit for clarity:

% ps -cle | sort -k 7,7 | tail -25 F S UID PID PPID CLS PRI ADDR SZ WCHAN TTY TIME CMD 8 S 10002 24097 24060 TS 58 61518010 346 6101627e ? 0:01 xterm 8 S 10002 27452 24102 TS 58 61216cd8 1297 6101663e pts/15 0:14 xemacs 8 S 10003 10417 1 TS 58 60602668 370 60aebd36 ? 0:00 xterm 8 S 65533 21162 21161 TS 58 613d6670 346 610162a6 ? 0:00 xterm 8 S 65533 21305 21174 TS 58 612ff9a0 257 6194b156 pts/30 0:00 tcsh 8 S 65533 29569 27210 TS 58 612f0cd8 231 61017f16 ? 0:00 httpd ...

Get Web Performance Tuning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.