
4285ch02.fm Draft Document for Review May 4, 2007 11:35 am
52 Linux Performance and Tuning Guidelines
To display three entries of statistics for all processors of a multiprocessor server at
one-second intervals, use the command:
mpstat -P ALL 1 2
Example 2-18 Output of mpstat command on two-way machine
[root@linux ~]# mpstat -P ALL 1 2
Linux 2.6.9-5.ELsmp (linux.itso.ral.ibm.com) 04/22/2005
03:31:51 PM CPU %user %nice %system %iowait %irq %soft %idle intr/s
03:31:52 PM all 0.00 0.00 0.00 0.00 0.00 0.00 100.00 1018.81
03:31:52 PM 0 0.00 0.00 0.00 0.00 0.00 0.00 100.00 991.09
03:31:52 PM 1 0.00 0.00 0.00 0.00 0.00 0.00 99.01 27.72
Average: CPU %user %nice %system %iowait %irq %soft %idle intr/s
Average: all 0.00 0.00 0.00 0.00 0.00 0.00 100.00 1031.89
Average: 0 0.00 0.00 0.00 0.00 0.00 0.00 100.00 795.68
Average: 1 0.00 0.00 0.00 0.00 0.00 0.00 99.67 236.54
For the complete syntax of the mpstat command, issue:
mpstat -?
2.3.9 numastat
With Non-Uniform Memory Architecture (NUMA) systems such as the IBM System x 3950,
NUMA architectures have become mainstream in enterprise data centers. However, NUMA
systems introduce new challenges to the performance tuning process: Topics such as
memory locality were of no interest until NUMA systems arrived. Luckily, Enterprise Linux
distributions provides a tool for monitoring the behavior of NUMA architectures. The numastat
command provides information about the ratio of local versus remote memory usage and the
overall memory configuration of all nodes. Failed allocations of local memory as displayed in
the numa_miss column and allocations of remote memory (slower memory) as displayed in
the numa_foreign column should be investigated. Excessive allocation of remote memory will
increase system latency and most likely decrease overall performance. Binding processes to
a node with the memory map in the local RAM will most likely improve performance.
Example 2-19 Sample output of the numastat command
[root@linux ~]# numastat
node1 node0
numa_hit 76557759 92126519
numa_miss 30772308 30827638
numa_foreign 30827638 30772308
interleave_hit 106507 103832
local_node 76502227 92086995
other_node 30827840 30867162
2.3.10 pmap
The pmap command reports the amount of memory that one or more processes are using. You
can use this tool to determine which processes on the server are being allocated memory and