check cpu (sar -u)-->check memory (vmstat)-->check disk(iostat)
**************************************************
aix performance tools
identify causes of bottlenecks
cpu tprof
memory svmon
I/O filemon
**************************************************
root@wjlcnaix:/tmp>tprof -x sleep 10
Mon Apr 11 10:36:26 2011
System: AIX 5.3 Node: wjlcnaix Machine: 00C91D604C00
Starting Command sleep 10
stopping trace collection.
Generating sleep.prof
root@wjlcnaix:/tmp>cat sleep.prof
Configuration information
=========================
System: AIX 5.3 Node: wjlcnaix Machine: 00C91D604C00
svmon 捕获并分析内存快照
root@wjlcnaix:/tmp>svmon -P 1
-------------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 16MB
1 init 91765 65539 0 91746 N N N
PageSize Inuse Pin Pgsp Virtual
s 4 KB 181 3 0 162
m 64 KB 1628 0 0 1628
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
0 0 work kernel segment (lgpg_vsid=0) L 16 16 0 16
2b30ad d work shared library text m 1628 0 0 1628
14001 2 work process private s 103 3 0 103
6401d f work shared library data s 59 0 0 59
7c01b 1 clnt code,/dev/hd2:61 s 12 0 - -
52434d - clnt /dev/hd4:1422 s 7 0 - -
filemon command
Monitors the performance of the file system, and reports the I/O activity on behalf of logical files, virtual memory
segments, logical volumes, and physical volumes.
root@wjlcnaix:/tmp>filemon
Run trcstop command to signal end of trace.
root@wjlcnaix:/tmp>Mon Apr 11 10:43:20 2011
System: AIX 5.3 Node: wjlcnaix Machine: 00C91D604C00
root@wjlcnaix:/tmp>ls -l |grep kak
-rw-r--r-- 1 root system 335 Apr 01 10:59 kakaalog.add
root@wjlcnaix:/tmp>cat kakaalog.add
SWservAt:
attribute="alog_type"
deflt="kakalog"
value="kakalog"
root@wjlcnaix:/tmp>file kakaalog.add
kakaalog.add: commands text
root@wjlcnaix:/tmp>file ha54
ha54: directory
root@wjlcnaix:/tmp>trcstop
**************************************************************
#####
#cpu#
#####
ps aux
alias top="ps aux | tail +2 | sort -nr -k 3,3"
root@wjlcnaix:/tmp>ps -elf
F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD
200003 A root 1 0 0 60 20 14001400 676 Feb 22 - 0:22 /etc/init
240001 A root 278542 1 0 60 20 46c31f400 536 * Feb 22 - 97:08 /usr/sbin/syncd 60
C 每秒钟衰减一半
PRI 越大优先权越低
PRI=40+nice+CPU/2
系统进程PRI在40以下,用户进程基本在40以上
sar -u 30 30
a system may be cpu bound,if: %usr+%sys>80%
root@wjlcnaix:/tmp>sar -P ALL -u 2 2
AIX wjlcnaix 3 5 00C91D604C00 04/11/11
System configuration: lcpu=64 mode=Capped
11:14:20 cpu %usr %sys %wio %idle physc
11:14:22 0 0 0 0 100 0.53
1 0 0 0 100 0.47
2 0 0 0 100 0.52
3 0 0 0 100 0.48
4 0 0 0 100 0.53
5 0 0 0 100 0.47
6 0 0 0 100 0.53
7 0 0 0 100 0.48
8 0 0 0 100 0.53
...
tprof 可分析源码(c语言)
bindproccessor 把进程绑到单个cpu使用:
To bind the threads in process 19254 to processor 1, type:
>bindprocessor 19254 1
########
#memory#
########
root@wjlcnaix:/tmp>vmstat 1 1
System configuration: lcpu=64 mem=62976MB
kthr memory page faults cpu
----- ----------- ------------------------ ------------ -----------
r b avm fre re pi po fr sr cy in sy cs us sy id wa
0 0 3100183 12202964 0 0 0 0 0 0 12 3175 401 0 0 99 0
r/lcpu > 1 cpu瓶颈
pi po 超过20以上,说明内存交换过频繁。
svmon -G 全局报告
sizes are in # of 4k frames. 1页=4k
pers+clnt+virtual 与总的物理内存比较,大于则说明物理内存不够
root@wjlcnaix:/tmp>svmon -G
size inuse free pin virtual
memory 16121856 3918897 12202959 2511167 3100184
pg space 2097152 7877
work pers clnt other
pin 1971680 0 0 539487
in use 3100184 0 818713
PageSize PoolSize inuse pgsp pin virtual
s 4 KB - 3749009 7877 2399663 2930296
m 64 KB - 10618 0 6969 10618
root@wjlcnaix:/tmp>svmon -Pt 3
-------------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 16MB
475184 oracle 261880 65584 0 256523 Y N N
PageSize Inuse Pin Pgsp Virtual
s 4 KB 195000 0 0 189643
m 64 KB 84 3 0 84
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
0 0 work kernel segment (lgpg_vsid=0) L 16 16 0 16
1a8c6e 70000049 work default shmat/mmap s 36329 0 0 36329
1acc6f 7000004a work default shmat/mmap s 15232 0 0 15232
##########
#Disk I/O#
##########
root@wjlcnaix:/tmp>iostat 1 1
System configuration: lcpu=64 drives=22 paths=126 vdisks=0
tty: tin tout avg-cpu: % user % sys % idle % iowait
0.0 62.0 0.0 0.1 99.9 0.0
Disks: % tm_act Kbps tps Kb_read Kb_wrtn
hdisk0 0.0 0.0 0.0 0 0
% tm_act 正常值低于 70%
% iowait 大于25%有瓶颈
filemon 示例:
root@wjlcnaix:/tmp>filemon -o fmout
Run trcstop command to signal end of trace.
root@wjlcnaix:/tmp>Mon Apr 11 11:35:15 2011
System: AIX 5.3 Node: wjlcnaix Machine: 00C91D604C00
root@wjlcnaix:/tmp>trcstop
root@wjlcnaix:/tmp>[filemon: Reporting started]
[filemon: Reporting completed]
[filemon: 10.102 secs in measured interval]
root@wjlcnaix:/tmp>more fmout
Mon Apr 11 11:35:15 2011
System: AIX 5.3 Node: wjlcnaix Machine: 00C91D604C00
Cpu utilization: 51.5%
Cpu allocation: 100.0%
***********************************************
性能调试:cpu-->memory-->disk
***********************************************
topas: cpu info;iostat info;netstat info;vmstat info;nfsstatinfo
Simultaneous Multi-Threading (SMT)
smtctl [ -m off | on [ -w boot | now]]
阅读(3088) | 评论(0) | 转发(1) |