I have been complimented many times and they always embarrass me; I always feel that they have not said enough. (Mark Twain)
Computers have been taught to distrust each other and will reject attempted connections most of the time. Nowadays, most computers and firewalls are utterly rude about it: it would be like asking someone to dance and having them ignore you as though you were invisible and inaudible. (Tony Lawrence)
package is a set of tools that those of us from the Unix world sorely
missed on Linux.
Most missed was sar. A few years back, SCO had released sar so that it
could be ported to Linux, but the initial work was slow and lacked
many features. I'm glad to see that's all changed.
When I mention this to Linux folk, the first reaction is usually "What do I need that for? It's all in /proc!". Well, that's not really the point.
The value of sar (for those not familiar with it) is that it
collects statistics through cron (the sysstat rpm automatically
installs a "sysstat" job in /etc/cron.d for this). You can
examine the results at your leisure, but more importantly this means
that you can see what "normal" performance looks like for your system,
which is critically important in diagnosing sudden problems.
Without any flags, sar reports cpu usage:
07:00:00 AM CPU %user %nice %system %iowait %idle
07:10:00 AM all 0.27 0.00 0.14 0.06 99.53
07:20:00 AM all 1.22 0.00 1.58 0.41 96.80
07:30:00 AM all 0.14 0.00 0.09 0.00 99.76
07:40:00 AM all 0.30 0.00 0.39 0.19 99.11
A neat feature of sar I wasn't aware of is the ability to run it against
a specific process id:
# sar -x 29801 5 50
07:03:12 AM PID minflt/s majflt/s %user %system nswap/s CPU
07:03:17 AM 29801 0.00 0.00 0.00 0.00 0.00 0
07:03:22 AM 29801 1.60 0.00 0.20 0.00 0.00 0
07:03:27 AM 29801 1.60 0.00 0.00 0.20 0.00 0
07:03:32 AM 29801 1.40 0.00 0.20 0.00 0.00 0
Many other reports are available; see the man page. Through a "sa2"
script (enabled in the sysstat crontab), daily ASCII versions of
full sar reports are produced in the /var/log/sa directory.
On more recent kernels, "iostat -x" displays even more information.
Finally, "mpstat", shows cpu specific data and can report on multiple
cpu's if present:
09:04:35 AM CPU %user %nice %system %iowait %irq %soft %idle intr/s
09:04:35 AM all 0.73 0.06 0.76 1.56 0.06 0.00 96.82 122.40
Of course with any of these, understanding the information presented
is the hard part. The man pages are short on details, and even if you
track some of these to their source, it can still be difficult to
understand what a particular statistic implies about the state of
your system and what, if anything, you should do about it. So
much to learn, so little time..
CPU usage from u386mon
The u386mon is like "top", with multiple pages showing network statistics, kernel and memory statistics and a dynamic display of highest cpu using processes.
Interestingly, there are multiple references in Google talking about porting u386mon to Linux, but I can't find where anyone acutally has.