免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2017 | 回复: 0
打印 上一主题 下一主题

[性能调优] AIX 性能调优 内存篇之四 调优参数 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-08 09:34 |只看该作者 |倒序浏览

本章介绍和AIX内存调优相关的参数
minfreemaxfree
(1) minfree
空闲列表中可接受的实际内存页面帧的最小数量。当空闲列表的大小低于这个数时,VMM 开始替换页面。它将一直替换页面直到空闲列表的大小达到 maxfree。
# vmo -a |grep minfree
               minfree = 960
(2) maxfree
当free list的大小超过maxfree的时候, VMM的page stealing将停止. 当进程终止并释放它们的工作段页面或删除其页面在内存中的文件时,结果是空闲列表的大小可能会超过这个数。
# vmo -a |grep maxfree
               maxfree = 1088

从AIX 5.3开始, minfree parameter的缺省值 is increased to 960 per memory
pool and maxfree parameter的缺省值 is increased to 1088 per memory pool.

minperm%, maxperm%maxclient%
(1) minperm%
如果由文件页面占有的实际内存的百分比低于这个级别,则页面替换算法既替换文件页面也替换计算页面,而不管repage rate。
# vmo -a |grep minperm%
              minperm% = 20

(2) maxperm%
如果由文件页面占有的实际内存的百分比高于这个级别,则页面替换算法仅替换文件页面。
# vmo -a |grep maxperm%
              maxperm% = 80

(3) maxclient%
如果由文件页面占有的实际内存的百分比高于这个级别,则页面替换算法仅替换客户机页面。
# vmo -a |grep maxclient%
            maxclient% = 80

当由文件页面占有的实际内存的百分比处于 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
[color="#0000ff"]                 80.0 maxpin percentage
[color="#0000ff"]                 20.0 minperm percentage
[color="#0000ff"]                 80.0 maxperm percentage
[color="#0000ff"]                 66.2 numperm percentage
              2565739 file pages
                  0.0 compressed percentage
                    0 compressed pages
[color="#0000ff"]                 66.7 numclient percentage
[color="#0000ff"]                 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

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

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/51714/showart_521414.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP