mysql 效率 aix_AIX 性能调优 内存篇之四 调优参数

本章介绍和AIX内存调优相关的参数

minfree和maxfree

(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

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例子请参见内存调优的工程经验篇.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值