AIX下io性能调优 (转帖)

AIX上io性能调优 (转帖)
通过命令vmstat -v查看io瓶颈
# vmstat -v
0--- pending disk I/Os blocked with no pbuf(物理卷缓存)
0--- paging space I/Os blocked with no psbuf(交换分区缓存)
2740- filesystem I/Os blocked with no fsbuf(文件系统缓存:JFS)
1678- client filesystem I/Os blocked with no fsbuf(文件系统缓存:nfs、VxFS)
0--- external pager filesystem I/Os blocked with no fsbuf(文件系统缓存:JFS2)
IO参数调整
(命令如:ioo -p -o maxrandwrt=4, 可以用ioo -L 显示详细信息,包括参数值的缺省值、最小值、最大值)
1、如果打开文件数据特别多的场合
增大j2_inodeCacheSize参数值(1-1000)
2、如果打开文件数目不多,但文件特别大的场合:
增大j2_metadataCacheSize参数值(0-1000),建议不要超过400
3、使用裸设备(stripe LVM)的场合:
增大lvm_bufcnt参数值(1-64)
4、如果“pending disk I/Os blocked with no pbuf”值太高
增大pv_min_pbuf参数值(512-2G-1)
5、减少磁盘写的次数
1)可以让syncd进程频发
2)增大maxrandwrt、j2_maxRandomWrite参数值(0-65536)
3)如果使用条化(stripe)逻辑卷或者磁盘阵列,增大numclust参数值,增大j2_nPagesPerWriteBehindCluster参数值(0-65536)可能会有用
6、如果“filesystem I/Os blocked with no fsbuf、client filesystem I/Os blocked with no fsbuf、external pager filesystem I/Os blocked with no fsbuf”太高
增大numfsbufs、j2_dynamicBufferPreallocation、j2_nBufferPerPagerDevice参数值(0-256)
9、如果系统存在大量顺序读操作(sequentially accessed file)
增大j2_minPageReadAhead、j2_maxPageReadAhead参数值(0-65536),增大minpgahead、maxpgahead(0-4096,should be a power of two)
10、如果“paging space I/Os blocked with no psbuf”太高
可能是内存太小,假如是oracle数据库,设置sga_lock=true

文件同步性调优的三个办法:
1)打开sync_release_ilock选项(ioo -p -o sync_release_ilock=1)
2)提高syncd 守护程序的同步频率(修改/sbin/rc.boot文件,缺省是60秒,可以改为30秒)
3)打开随机后写功能(ioo -p -o j2_maxRandomWrite=32)

注:JFS 通过改变 minpgahead、maxpgahead、maxrandwrt、numfsbufs 的值调优,而增强型 JFS 使用对应这几个参数j2_minPageReadAhead 、j2_maxPageReadAhead、j2_maxRandomWrite、j2_nBufferPerPagerDevice。