Professional Documents
Culture Documents
Agenda
This course applies to students who want to know about PerfPMR, how
to generate reports and what parameters apply.
It also helps with determining when there is a performance issue, what
to review and what the possible causes of the issue can be.
This course assumes students are familiar with IBM AIX® performance
tools.
Click the Notes tab on the left to see the accompanying notes text.
2
© 2007 IBM Corporation
3
© 2007 IBM Corporation
Running PERFPMR
Once PERFPMR has been installed, you can run it in any directory
► To determine the amount of space needed, estimate at least 20MB per
logical CPU plus an extra 50MB of space
► Run “perfpmr.sh <# of seconds>” at the time when the performance
problem is occurring
► A pair of 5-second traces are collected first
► Then various monitoring tools are run for the duration of time specified as
a parameter to perfpmr.sh
► After this, tprof, filemon, iptrace, tcpdump data is collected
► Finally, system configuration data is collected
► Data can be tar’d up and sent to testcase.software.ibm.com with the
filename having the pmr# in it
4
© 2007 IBM Corporation
Syntax
perfpmr.sh [-PQDIgfnpsc][-F file][-x file][-d sec] monitor_seconds
5
© 2007 IBM Corporation
6
© 2007 IBM Corporation
netstat.sh [-r] time Builds a report on network configuration and use called netstat.int containing
entstat -d of the Ethernet interfaces, netstat -in, netstat -m, netstat -rn,
netstat -rs, netstat -s, netstat -D, and netstat -an before and after monitor.sh
was run.
nfsstat.sh time Builds a report on NFS configuration and use called netstat.int containing
nfsstat -m, and nfsstat –csnr before and after nfsstat.sh was run. The time
parameter must be greater than or equal to 60.
pprof.sh time Builds a file called pprof.trace.raw that can be formatted with the pprof.sh -r
command. The time parameter does not have any restrictions.
ps.sh time Builds reports on process status (ps). ps.sh creates the following files:
psa.elfk: A ps -elfk listing after ps.sh was run.
psb.elfk: A ps -elfk listing before ps.sh was run.
ps.int Active processes before and after ps.sh was run.
ps.sum A summary report of the changes between when ps.sh started and
finished. This is useful for determining what processes are consuming
resources. The time parameter must be greater than or equal to 60.
7
© 2007 IBM Corporation
tcpdump.sh int.time The int. parameter is the name of the interface; for example, tr0 is token-ring.
Creates a raw trace file of a TCP/IP dump called tcpdump.raw. To produce a
readable tcpdump.int file, use the tcpdump.sh -r command.
tprof.sh time Creates a tprof summary report called tprof.sum. Used for analyzing memory
use of processes and threads. You can also specify a program to profile by
specifying the tprof.sh -p program 60 command, which enables you to profile the
executable-called program for 60 seconds.
trace.sh time Creates the raw trace files (trace*) from which an ASCII trace report can be
generated using the trcrpt command
vmstat.sh time Builds reports on vmstat: a vmstat interval report called vmstat_v and a
vmstat_s summary report The time parameter must be greater than or
equal to 60. .
8
© 2007 IBM Corporation
9
© 2007 IBM Corporation
Example
10
© 2007 IBM Corporation
Example (Cont.)
10:42:48-08/01/07 : PERFPMR: executing perfpmr_monitor -h -I 0 -N 0 -S 0 3
MONITOR: Capturing final lsps, svmon, and vmstat data
MONITOR: Generating reports....
MONITOR: Network reports are in netstat.int and nfsstat.int
MONITOR: Monitor reports are in monitor.int and monitor.sum
10:49:47-08/01/07 : PERFPMR: executing perfpmr_filemon -T 60000000 60
11
© 2007 IBM Corporation
Example (Cont.)
root@nkeung /home/nam/perfpmr/test: > ls
aiostat.int gennames.out mpstat.int tprof.csyms trace.syms
config.sum getevars.out netstat.int tprof.ctrc tunables_lastboot
crontab_l instfix.out nfsstat.int tprof.out tunables_lastboot.log
devtree.out iostat.Dl objrepos tprof.sum tunables_nextboot
errlog iptrace.raw perfpmr.int trace.crash.inode unix.what
errpt_a lparstat.int pile.out trace.fmt vfs.kdb
errtmplt lparstat.l pprof.trace.raw trace.inode vmstat_s.out
etc_filesystems lparstat.sum psa.elfk trace.j2.inode vmstat_s.p.after
etc_inittab lslpp.Lc psb.elfk trace.maj_min2lv vmstat_s.p.before
etc_rc lsps.after psemo.after trace.mount vmstat_v.after
etc_security_limits lsps.before psemo.before trace.nm vmstat_v.before
fastt.out lsrset.out sar.bin trace.raw vmstati.after
fcstat.after mem_details_dir svmon.after trace.raw-0 vmstati.before
fcstat.before mempools.out svmon.after.S trace.raw-1 vnode.kdb
filemon.sum mempools.save svmon.before trace.raw.lock w.int
genkex.out monitor.int svmon.before.S trace.raw.lock-0 xmwlm.070731
genkld.out monitor.sum tcpdump.raw trace.raw.lock-1 xmwlm.070801
12
© 2007 IBM Corporation
13
© 2007 IBM Corporation
curt.out
Hypervisor Calls Summary
------------------------
Count Total Time % sys Avg Time Min Time Max Time Tot ETime Avg ETime Min ETime
Max ET
ime HCALL (Cal(msec) time (msec) (msec) (msec) (msec) (msec) (msec)
(msec)
======== =========== ====== ======== ======== ======== ======== ========= =========
=========
625 169.1873 6.86% 0.2707 0.0014 2.8567 311.8368 0.4989 0.0077
3.7711 H_CONFER((unknown) 210178)
117 38.2630 1.55% 0.3270 0.0005 2.7299 57.9804 0.4956 0.0005
2.7299 H_CONFER((unknown) 2f2230)
14
© 2007 IBM Corporation
15
© 2007 IBM Corporation
CaseLock study
Activity – Ethernet
(mSecs) - InterruptsTransmit
Disabled Lock
(Continue)
SIMPLE Count Minimum Maximum Average Total
+++++++ ++++++ ++++++++++++++ ++++++++++++++ ++++++++++++++ ++++++++++++++
LOCK 1934 0.003430 0.182701 0.005955 11.406502
SPIN 1933 0.000568 0.164352 0.001174 2.256266
tprof.sum
17
© 2007 IBM Corporation
Profile: /usr/lib/libpthreads.a[shr.o]
18
© 2007 IBM Corporation
Modify the trcfmt file, add the following to the end of the trace.fmt file (Require debug libpthread
library)
020 1.0 "PTHREADS" \
"mutex_lock " $D1 $D2 $D3 $D4 $D5
040 1.0 "PTHREADS" \
"mutex " lockaddr=$D4 $D1 $D2 $D3
030 1.0 "PTHREADS" \
"mutex_unlock " $D1 $D2 $D3 $D4 $D5
The 020 and 040 trace hooks show the pthread lock trace hook whereas 030 and 040 show the
unlock trace hook. The 5 parms in 020 and 030 are the top 5 routines on the stack. The first
parm in 040 is the lock address and the last 3 parms of the 040 hook are the 6th, 7th, and 8th
stack addresses
19
© 2007 IBM Corporation
040 scp_server 27 410070 6755063 0.582794 PTHREADS mutex lockaddr=20444B50 1009E44C 1009C8D8 10038FAC
020 scp_server 32 410070 7184789 0.582797 PTHREADS mutex_lock D0300EFC D02FF57C D01C5DB0 100173F0
100174E0
040 scp_server 32 410070 7184789 0.582797 PTHREADS mutex lockaddr=20444B50 10017454 1009E6D8 10038BF8
030 scp_server 46 410070 6594563 0.582799 PTHREADS mutex_unlock D03027A8 D02FFCDC D01C82BC 1009E7E4
10038F0C
040 scp_server 46 410070 6594563 0.582800 PTHREADS mutex lockaddr=20444B50 1002F690 1002928C D1BD7288
020 scp_server 27 410070 6755063 0.582804 PTHREADS mutex_lock D0300EFC D02FF57C D01C5DB0 D01D0F14
100173C8
040 scp_server 27 410070 6755063 0.582805 PTHREADS mutex lockaddr=20444B50 100174E0 1009E460 1009C8D8
030 scp_server 4 410070 6598669 0.582805 PTHREADS mutex_unlock D03027A8 D02FFCDC D01C82BC 1009E5E4
10038F0C
040 scp_server 4 410070 6598669 0.582806 PTHREADS mutex lockaddr=20444B50 1002F690 1002928C D1BD7288
020 scp_server 38 410070 7131397 0.582807 PTHREADS mutex_lock D0300EFC D02FF57C D01C5DB0 D01D0F14
100173C8
040 scp_server 38 410070 7131397 0.582807 PTHREADS mutex lockaddr=20444B50 100174E0 1009E44C 10038DDC
030 scp_server 2 410070 6750965 0.582811 PTHREADS mutex_unlock D03014F4 D02FF57C D01C5DB0 D01D0F14
D1CBA968
040 scp_server 2 410070 6750965 0.582812 PTHREADS mutex lockaddr=20444B50 D1CB6EAC D1CC72C4 D1CC1C94
020 scp_server 46 410070 6594563 0.582813 PTHREADS mutex_lock D03022EC D02FFCDC D01C82BC 1009D0AC
1009E808
020 scp_server 32 410070 7184789 0.582813 PTHREADS mutex_lock D0300EFC D02FF57C D01C5DB0 100173F0
100174E0
20
© 2007 IBM Corporation
use the sym.sh with the sym to look at 020 stack trace
21
© 2007 IBM Corporation
T Acqui- Wait
y sitions or Locks or Percent Holdtime
p or Trans- Passes Real Real Comb
Lock Name, Class, or Address e Passes Spins form %Miss %Total / CSec CPU Elapse Spin
********************************** * ******* ****** ****** ******* ******** ********* ******** ********
********
F00000002FF48C98 C 74582 255 0 0.3407 2.2872 2284.374 184.9558 90932.0141
33.7647
lock_shm S 25870 25864 1246 49.9942 0.7933 792.373 2.7038 86.6720 9.2270
0000000002A65750 D 3500 1178 3 25.1817 0.1073 107.202 0.0445 1.4113
0.1217
0000000002A65A68 D 2534 1177 1 31.7165 0.0777 77.614 0.0480 1.5246
0.0724
0000000002A65A28 D 887 451 1 33.7070 0.0272 27.168 0.0224 0.7103
0.0614
0000000002A659D0 D 3773 726 0 16.1369 0.1157 115.563 0.0476 1.5147
0.0232
F100010052ECF6D8 C 13084 997 132 7.0805 0.4012 400.750 0.1719 5.5278
0.0142
00000000010A5438 D 51737 4690 0 8.3116 1.5866 1584.654 0.3101 11.6915
0.0094
lock_sem_undo S 17169 37 0 0.2150 0.5265 525.870 0.0353 1.1238
0.0075
ipintrq_qarray_lock D 66924 2058 0 2.9834 2.0523 2049.817 0.0933 2.9916
0.0053
22
© 2007 IBM Corporation
23
© 2007 IBM Corporation
24
© 2007 IBM Corporation
TPROF example
Configuration information
System: AIX 5.3 Node: rvn1 Machine: 00CC12CE4C00
Tprof command was:
tprof -E -skeulz -x sleep 30
Trace command was:
/usr/bin/trace -ad -M -L 1719908352 -T 500000 -j
000,00A,001,002,003,38F,005,006,134,139,5A2,5A5,465,2FF, -o -
Total Samples = 84268
Traced Time = 30.01s (out of a total execution time of 30.01s)
Performance Monitor based reports:
Processor name: POWER6
Sampling interval: 10ms
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Process FREQ Total Kernel User Shared Other
======= ==== ===== ====== ==== ====== =====
/cerner/…/srv_drvr 976 28105 3892 0 24210 3
/cerner/…/cpm_srvscript 212 17642 3039 43 14549 11
wait 32 14991 14991 0 0 0
oraclehrvst1 320 14751 3080 11442 210 19
/usr/bin/amqzlaa0 1504 3053 1694 65 1281 13
25
© 2007 IBM Corporation
26
© 2007 IBM Corporation
I/O Tuning – iostat -D Service times you could only get from filemon before
Application IO characteristics
Random IO
Typically small (4-32 KB)
Measure and size with IOPS
Usually disk actuator limited
Sequential IO
Typically large (32KB and up)
Measure and size with MB/s
Usually limited on the interconnect to the disk actuators
Check for trace buffer wraparounds which may invalidate the data, run
filemon with a larger –T value or shorter sleep
Use lvmstat to get LV IO statistics
Use iostat to get PV IO statistics
29
© 2007 IBM Corporation
Filemon
To find out what files, logical volumes, and disks are most active, run the following
command as root:
# filemon -u -O all -o /tmp/fmon.out; sleep 30;trcstop In 30 seconds, a report is created in
/tmp/fmon.out.
Check for most active segments, logical volumes, and physical volumes in this report.
Check for reads and writes to paging space to determine if the disk activity is true
application I/O or is due to paging activity.
Check for files and logical volumes that are particularly active. If these are on a busy
physical volume, moving some data to a less busy disk may improve performance. The
Most Active Segments report lists the most active files by file system and inode. The
mount point of the file system and inode of the file can be used with the ncheck command
to identify unknown files:
# ncheck -i <inode> <mount point> This report is useful in determining if the activity is to a
file system (segtype = persistent), the JFS log (segtype = log), or to paging space (segtype
= working).
#find /var/mqm –inum 30762
/var/mqm/qmgrs/CERN!RVN1!HRVSTA/queues/CERN!SSREQ!PM!REG/q
By examining the reads and read sequences counts, you can determine if the access is
sequential or random. As the read sequences count approaches the reads count, file
access is more random. The same applies to the writes and write sequences.
30
© 2007 IBM Corporation
31
© 2007 IBM Corporation
32
© 2007 IBM Corporation
33
© 2007 IBM Corporation
Using filemon
Look at PV summary report
Look for balanced IO across the disks
Lack of balance may be a data layout problem
Depends upon PV to physical disk mapping
LVM mirroring scheduling policy also affects balance for reads
IO service times in the detailed report is more definitive on data layout
issues
Dissimilar IO service times across PVs indicates IOs are not
balanced across physical disks
34
© 2007 IBM Corporation
zNotable metrics
z%hypv and hcalls: percentage of time in hypervisor and number of calls made
zpc: fraction of physical processor consumed by a logical processor
35
© 2007 IBM Corporation
36
© 2007 IBM Corporation
37
© 2007 IBM Corporation
38
© 2007 IBM Corporation
smtctl
This system is SSMT capable
SMT is currently enabled
SMT boot mod is not set
Processor 0 has 2 SMT threads
SMT thread 0 is bound with processor 0
SMT thread 1 is bound with processor 1
…
lsattr –El proc0
fequency 1904000000 Processor Speed False
smt_enabled true Processor SMT enabled False
smt_threads 2 Processor SMT threads False
state enable Processor state False
type PowerPC_POWER5 Processor type False
39
© 2007 IBM Corporation
41
CEC configuration info retrieved from HMC or specified on command line
© 2007 IBM Corporation
42
© 2007 IBM Corporation
43
© 2007 IBM Corporation
44
© 2007 IBM Corporation
45
© 2007 IBM Corporation
46
© 2007 IBM Corporation
47
© 2007 IBM Corporation
Must be running AIX5.3 TL5 Service pack 4 with APAR IY87993 or newer)
This option records the performance of all partitions on a physical server
The command is run on just one server
Start Recording
►#/usr/lpp/perfagent/config_topas.sh add
►The performance data is logged to: /etc/perf/topas_cec.YYMMDD
Stop Recording
►#/usr/lpp/perfagent/config_topas.sh delete
►Rename the /etc/perf/topas_cec.YYMMDD logfile so that a restart does not corrupt it
Summary Report
►# topasout -R summary /etc/perf/topas_cec.070805
#Report: CEC Summary --- hostname: localhost version:1.1
Start:08/05/07 17:24:43 Stop:08/05/07 17:37:43 Int: 5 Min Range: 13 Min
Partition Mon: 2 UnM: 0 Shr: 2 Ded: 0 Cap: 0 UnC: 2
-CEC------ -Processors------------------------- -Memory (GB)------------
Time ShrB DedB Mon UnM Avl UnA Shr Ded PSz APP Mon UnM Avl UnA InU
17:29 0.01 0.00 0.3 0.0 0.0 0 0.3 0 2.0 2.0 3.0 0.0 0.0 0.0 1.4
17:34 0.01 0.00 0.3 0.0 0.0 0 0.3 0 2.0 2.0 3.0 0.0 0.0 0.0 0.9
17:37 0.01 0.00 0.3 0.0 0.0 0 0.3 0 2.0 2.0 3.0 0.0 0.0 0.0 0.9
48
© 2007 IBM Corporation
49
© 2007 IBM Corporation
SVMON command
A n a n a ly sis to o l fo r v irtu a l m e m o ry
P u rp o se :
C a p tu re s a sn a p sh o t o f th e c u rre n t sta te o f m e m o ry .
T h e d isp la y o f in fo rm a tio n c a n b e a n a ly z e d u sin g fo u r d iffe re n t re p o rts:
g lo b a l [ -G ]
p ro c e ss [-P ]
se g m e n t [-S ]
d e ta ile d se g m e n t [-D ]
E x a m p le # sv m o n -G
siz e in u se fre e p in v irtu a l
m e m o ry 32636928 12958574 19678354 1453011 5842282
p g sp a c e 2097152 22267
w o rk p e rs c ln t
p in 1452772 239 0
in u se 5842282 834564 6281728
P a g e S iz e P o o lS iz e in u se p g sp p in v irtu a l
s 4 KB - 12679102 22267 1253811 5562810
m 64 K B - 17467 0 12450 17467
50
© 2007 IBM Corporation
#vmstat 1 4
configuration: System lcpu=32 mem=127488MB
kthr memory page faults cpu
----- ----------- ------------------------ ------------ -----------
r b avm fre re pi po fr sr cy in sy cs us sy id wa
0 0 5842256 19678557 0 0 0 0 0 0 6 1223 1251 0 0 99 0
0 0 5842255 19678558 0 0 0 0 0 0 5 1026 1200 0 0 99 0
0 0 5842253 19678560 0 0 0 0 0 0 4 853 1130 0 0 99 0
2 0 5842253 19678560 0 0 0 0 0 0 5 1046 1218 0 0 99 0
# svmon -G
size inuse free pin virtual
memory 32636928 12958401 19678527 1453001 5842265
pg space 2097152 22267
51
© 2007 IBM Corporation
52