Chapter 8. Open system servers - Linux for xSeries 285
8.3.5 vmstat
vmstat provides information about processes, memory, paging, block I/O, traps, and CPU
activity. Example 8-12 shows a sample vmstat output.
Example 8-12 Output of vmstat
procs memory swap io system cpu
r b w swpd free buff cache si so bi bo in cs us sy id
2 0 0 0 39256 19820 159460 0 0 200 100 133 141 31 5 64
The columns in the output are as follows:
򐂰 procs
r: The number of processes waiting for runtime.
b: The number of processes in un-interruptible sleep.
w: The number of processes swapped out but otherwise runnable. This field is
calculated, but Linux never desperation swaps.
򐂰 memory
swpd: The amount of virtual memory used (KB)
free: The amount of idle memory (KB)
buff: The amount of memory used as buffers (KB)
򐂰 swap
si: Amount of memory swapped in from disk (KB/s)
so: Amount of memory swapped to disk (KB/s)
򐂰 IO
bi: Blocks sent to a block device (blocks/s)
bo: Blocks received from a block device (blocks/s)
򐂰 system
in: The number of interrupts per second, including the clock
cs: The number of context switches per second
򐂰 cpu (these are percentages of total CPU time):
–us: User time
sy: System time
id: Idle time
8.3.6 sar
The sar command, which is included in the sysstat package, uses the standard system
activity daily data file to generate a report.
To install the sysstat package, log in as root and mount the CD-ROM containing the package.
Then do the following steps:
cd /mnt/cdrom/RedHat/RPMS
Or:
mount -t iso9660 /dev/cdrom /mnt
rpm -Uivh sysstat sysstat-3.3.5-3.i386.rpm
286 IBM TotalStorage DS6000 Series: Performance Monitoring and Tuning
You can also obtain the sysstat package at:
http://perso.wanadoo.fr/sebastien.godard/
The system has to be configured to grab the information and log it; therefore, a cron job must
be set up. Add the following lines to the /etc/crontab. Example 8-13 illustrates an example of
automatic log reporting with
cron.
Example 8-13 Example of automatic log reporting with cron
....
#8am-7pm activity reports every 10 minutes during weekdays.
0 8-18 **1-5 /usr/lib/sa/sa1 600 6 &
#7pm-8am activity reports every an hour during weekdays.
0 19-7 **1-5 /usr/lib/sa/sa1 &
#Activity reports every an hour on Saturday and Sunday.
0 ***0,6 /usr/lib/sa/sa1 &
#Daily summary prepared at 19:05
5 19 ***/usr/lib/sa/sa2 -A &
....
You get a detailed overview of your CPU utilization (%user, %nice, %system, %idle), memory
paging, network I/O and transfer statistics, process creation activity, activity for block devices,
and interrupts/second over time.
These are the main values that are displayed if you use sar -A (the -A is equivalent to
-bBcdqrRuvwWy -I SUM -I PROC -n FULL -U ALL, which selects the most relevant counters of
the system):
kbmemfree Free memory in KB
kbmenmuse Used memory in KB (without memory used by the kernel)
%memused Percentage of used memory
kbmemshrd Amount of shared memory by the system (always 0 with kernel 2.4)
kbbuffers Memory used for buffers by kernel in KB
kbcached Memory used for caching by kernel in KB
kbswpfree Free swap space in KB
kbswpused Used swap space in KB
%swpused Percentage of used swap space
intr/s Interrupts per second
Example 8-14 shows a sample of the output of the sar -A command.
Example 8-14 Example sar -A
Linux 2.4.7-10 (nf5000)11/07/2001
05:00:01 PM proc/s
05:10:00 PM 13.16
05:20:00 PM 0.14
05:30:00 PM 0.05
05:40:00 PM 0.05
05:50:01 PM 0.05
06:00:01 PM 0.05
06:10:01 PM 0.07
06:20:01 PM 0.05
06:30:00 PM 0.05
Chapter 8. Open system servers - Linux for xSeries 287
06:40:00 PM 0.05
06:50:00 PM 0.05
07:00:00 PM 0.05
07:09:59 PM 0.41
07:20:00 PM 0.12
07:30:00 PM 0.41
07:40:00 PM 0.49
07:50:00 PM 0.33
08:00:00 PM 0.26
08:10:02 PM 0.20
Average:0.85
05:00:01 PM cswch/s
...
Average:130.10
05:00:01 PM CPU %user %nice %system %idle
...
Average:all 5.67 0.03 33.46 60.84
05:00:01 PM INTR intr/s
...
Average:sum 114.41
05:00:01 PM pgpgin/s pgpgout/s activepg inadtypg inaclnpg inatarpg
...
Average:123.07 128.17 6011 17141 438 422
05:00:01 PM pswpin/s pswpout/s
...
Average:0.00 0.00
05:00:01 PM tps rtps wtps bread/s bwrtn/s
...
Average:10.89 5.46 5.43 246.15 256.34
05:00:01 PM frmpg/s shmpg/s bufpg/s campg/s
...
Average:0.01 0.00 -0.02 -1.84
05:00:01 PM kbmemfree kbmemused %memused kbmemshrd kbbuffers kbcached kbswpfree kbswpused
%swpused
...
Average:20006 235566 92.17 0 44418 49939 1048120 0
0.00
05:00:01 PM CPU i000/s i001/s i002/s i008/s i010/s i011/s i012/s i014/s i015/s
...
Average:0 100.00 0.90 0.00 0.00 0.00 9.68 0.67 3.16 0.00
05:00:01 PM dentunusd file-sz %file-sz inode-sz super-sz %super-sz dquot-sz %dquot-sz
rtsig-sz %rtsig-sz
...
Average:176307 491 5.99 178411 11 4.30 0 0.00
1 0.00
05:00:01 PM IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
...
Average:lo 0.01 0.01 0.35 0.35 0.00 0.00 0.00
Average:eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:00:01 PM IFACE rxerr/s txerr/s coll/s rxdrop/s txdrop/s txcarr/s rxfram/s
rxfifo/s txfifo/s
...
Average:lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00
Average:eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00
05:00:01 PM totsck tcpsck udpsck rawsck ip-frag
...
Average:77 6 3 0 0
05:00:01 PM runq-sz plist-sz ldavg-1 ldavg-5

Get IBM TotalStorage DS6000 Series: Performance Monitoring and 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.