AIX 性能调优(4)

2019-05-24 20:18

当由文件页面占有的实际内存的百分比处于 minperm 和 maxperm 之间时,VMM 通常只替换文件页面,但是如果文件页面的重新调页(repaging)率高于计算页面的重新调页率的话,计算页面也被替换。页面替换算法的主要意图是确保计算页面得到合理的待遇。例如,对于可能会很快再次使用的程序文本页,顺序读取长的数据文件到内存中应该不会使它们丢失。对阈值和重新调页率使用页面替换算法可确保合理地对待这两种类型的页面,但仍稍微偏向有利于计算页面的一方。

通过vmstat -v可以看到当前persistent或者client page的数目和百分比,可以作为系统调优的依据. # vmstat -v

4079616 memory pages 3870685 lruable pages 601736 free pages 2 memory pools 535883 pinned pages 80.0 maxpin percentage 20.0 minperm percentage 80.0 maxperm percentage 66.2 numperm percentage 2565739 file pages

0.0 compressed percentage 0 compressed pages 66.7 numclient percentage 80.0 maxclient percentage 2583086 client pages

0 remote pageouts scheduled

28222 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 0 client filesystem I/Os blocked with no fsbuf

106338 external pager filesystem I/Os blocked with no fsbuf

List-based LRU (page_steal_method)

在AIX 5.3, LRU算法可以用lists或者page frame table,在AIX 5.3之前,只有page frame table的算法, The list-based algorithm provides a list of pages to scan for each type of segment. 下面是段类型的列表:

? ? ? ?

Working Persistent Client Compressed

# vmo -a |grep page_steal_method page_steal_method = 0

如果page_steal_method = 1, 将采用list-based LRU算法, 如果

page_steal_method parameter 为 0, 将采用physical-address-based scanning的方式. page_steal_method参数值只有在bosboot and reboot后生效. # vmo -L page_steal_method

NAME CUR DEF BOOT MIN MAX UNIT TYPE DEPENDENCIES

------------------------------------------------------------------------------- page_steal_method 0 0 0 0 1 boolean B -------------------------------------------------------------------------------

strict_maxperm

缺省为0. 当strict_maxperm 设置成 1, places a hard limit on how much memory is used for a persistent file cache by making the maxperm value be the upper limit for this file cache. 当达到上线的时候least recently used (LRU)将执行在persistent pages上.

# vmo -a |grep strict_maxperm strict_maxperm = 0

Enhanced JFS file system cache 相关的参数: maxclient, strict_maxclient和lru_file_repage

Enhanced JFS file system cache使用client page来作为buffer cache,通过maxclient%来控制page stealing. 如果strict_maxlient设置为0, maxclient%将用来作为一个soft limit. 也就是说client pages可以超过maxclient参数,如果超过这个值,只有client file page被stolen.

当lru_file_repage设置为1的时候,如果client pages的数目介于minperm和maxclient之间, LRU算法将参考repage的计数. 最近没有被referenced的page将被stolen. If the value of the file repage counter is higher than the value of the computational repage counter, computational pages, which are the working storage, are selected for replacement. If the value of the computational repage counter exceeds the value of the file repage counter, file pages are selected for replacement.

当lru_file_repage设置为0的时候, 如果client pages的数目大于minperm,将选择file pages被替换.如果小于minperm,任何没有被referenced的page将被替换. 注意:maxclient同样影响NFS client和compressed pages. # vmo -a |grep lru_file_repage lru_file_repage = 1 # vmo -a |grep strict_maxclient strict_maxclient = 1 工程经验

内存调优主要集中在几个关键参数中,往往这几个关键参数就能很大地提高系统的内存使用性能. 这几个参数是minperm%, maxperm%, maxclient%和lru_file_repage. 原则:首先了解你的应用类型,是文件读写型还是数据库类型. 尽量保证你的应用运行所需要的数据充分地利用物理内存. 具体的工程Tips例子请参见内存调优的工程经验篇.

AIX 性能调优 内存篇之五 常用命令一 序号 版本号 更改人 日期 备注 1 1.0版 bldmickey 2007-06-20 本章介绍和AIX内存调优用到的常用命令.

vmstat

# vmstat

System configuration: lcpu=8 mem=15936MB

kthr memory page faults cpu ----- ----------- ------------------------ ------------ ----------- r b avm fre re pi po fr sr cy in sy cs us sy id wa 1 1 894941 601322 0 0 0 2 3 0 15 862 286 0 0 99 1 avm Active virtual pages

avm定义为the number of virtual-memory working segment pages that have actually been touched. 此值可能会比实际物理内存的frame要大,因为一些active virtual memory可能会被写入到paging space中. 表示的是当前进程使用的stack,变量,共享内存段等类型的内存,但是不包括进程可能打开的文件所占用的内存. fre Size of the free list

fre物理内存实际剩余的page数目 pi Pages paged in from paging space po Pages paged out to paging space 正常情况下pi和po不应该持续为非0值; fr Pages freed (page replacement).

sr Pages scanned by page-replacement algorithm 正常情况下fr和sr基本一致;

r Average number of runnable kernel threads over the sampling interval. Runnable refers to threads that are ready but waiting to run and to those threads already running. 正常情况下一般r<5

b Average number of kernel threads placed in the VMM wait queue (awaiting resource, awaiting input/output) over the sampling interval.

wa CPU idle time during which the system had outstanding disk/NFS I/O request(s). See detailed description above.

b和wa正常的情况下都不大,高的wa(I/O wait)和高的b(在队列中等待的线程数目)有可能是paging in和out导致的. 工程经验

?

avm可以作为长期监控系统内存使用率的趋势分析,如果你有监控软件, 长时间监控avm可以给你很好的内存使用的趋势. 虽然它不代表实际系统用了多少内存,但是作为趋势判断还是非常有效的.

? 判断内存是否缺少内存的一个工程依据: fre少于minfree并且有持续的page in和page out出现.

其它的值:fr,sr,r,b,wa可以作为一些参考的值.

?

# vmstat -s

531921073 total address trans. faults 298718704 page ins 66764084 page outs

0 paging space page ins 0 paging space page outs 0 total reclaims

207574145 zero filled pages faults 32015 executable filled pages faults 53623328 pages examined by clock


AIX 性能调优(4).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:苏教版小学一年级数学下册期中试卷WORD春季

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: