有关在AIX平台使用Large Page Memory的详细内容参考文章:《How to enable Large Page Feature on AIX-Based Systems [ID 372157.1]》http://space.itpub.net/?uid-23135684-action-viewspace-itemid-742753
结合METALINK的文章,AIX平台下的16M Large Page Memory配置如下:
# oslevel -s
6100-07-05-1228
# vmo -L v_pinshm
NAME CUR DEF BOOT MIN MAX UNIT TYPE
DEPENDENCIES
--------------------------------------------------------------------------------
v_pinshm 0 0 0 0 1 boolean D
--------------------------------------------------------------------------------
# vmo -po v_pinshm=1
Setting v_pinshm to 1 in nextboot file
Setting v_pinshm to 1
# vmo -L v_pinshm
NAME CUR DEF BOOT MIN MAX UNIT TYPE
DEPENDENCIES
--------------------------------------------------------------------------------
v_pinshm 1 0 1 0 1 boolean D
--------------------------------------------------------------------------------
# vmo -L maxpin%
NAME CUR DEF BOOT MIN MAX UNIT TYPE
DEPENDENCIES
--------------------------------------------------------------------------------
maxpin% 80 80 80 1 100 % memory D
pinnable_frames
memory_frames
--------------------------------------------------------------------------------
# lsuser -a capabilities oracle
oracle capabilities=CAP_BYPASS_RAC_VMM,CAP_PROPAGATE,CAP_NUMA_ATTACH
# lsuser -a capabilities grid
grid capabilities=CAP_BYPASS_RAC_VMM,CAP_PROPAGATE,CAP_NUMA_ATTACH
ent_mem_cap I/O memory entitlement in Kbytes False
goodsize 31488 Amount of usable physical memory in Mbytes False
mem_exp_factor Memory expansion factor False
size 31488 Total amount of physical memory in Mbytes False
var_mem_weight Variable memory capacity weight False
# vmo -p -o lgpg_regions=1024 -o lgpg_size=16777216
Setting lgpg_size to 16777216 in nextboot file
Setting lgpg_regions to 1024 in nextboot file
Warning: although the change concerns a dynamic tunable, bosboot should be run to optimally restore these settings at reboot
Setting lgpg_size to 16777216
Setting lgpg_regions to 1024
# vmo -o lru_file_repage=0
Setting lru_file_repage to 0
Warning: a restricted tunable has been modified
# bosboot -a
bosboot: Boot image is 51228 512 byte blocks.
# vmstat -l
System configuration: lcpu=16 mem=31488MB
kthr memory page faults cpu large-page
----- ----------- ------------------------ ------------ ----------- -----------
r b avm fre re pi po fr sr cy in sy cs us sy id wa alp flp
1 1 899643 7522 0 0 0 47 63 0 21 2107 579 0 0 99 0 0 1024
# svmon
size inuse free pin virtual mmode
memory 8060928 8042431 18497 4724020 902447 Ded
pg space 2621440 3418
work pers clnt other
pin 292772 0 0 236944
in use 902447 0 2945680
PageSize PoolSize inuse pgsp pin virtual
s 4 KB - 3372319 3418 310180 426639
m 64 KB - 29738 0 13721 29738
L 16 MB 1024 0 0 1024 0
下面是调整Oracle数据库实例参数后使用Large Page Memory的过程:
$ sql
SQL*Plus: Release 11.2.0.3.0 Production on Thu Sep 6 15:00:51 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter system set sga_max_size=16g scope=spfile;
System altered.
SQL> alter system set sga_target=16g scope=spfile;
System altered.
SQL> alter system set pre_page_sga=true scope=spfile;
System altered.
SQL> alter system set lock_sga=true scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount
ORA-27102: out of memory
IBM AIX RISC System/6000 Error: 12: Not enough space
服务器总共有32G的内存,Large Page Memory设置的是16G,Oracle数据库实例SGA设置的也是16G,但数据库实例启动的时候由于粒度的原因占用的空间可能稍微大于16G,那么Large Page Memory空间是不够用的(这段空间自动分配之后就被占据,不被任何程序使用,Oracle实例无法使用,空间即被浪费),剩余的空间也是不够的,所以报内存不足。解决办法是将lgpg_regions增加1即可:
# vmo -p -o lgpg_regions=1025 -o lgpg_size=16777216
Setting lgpg_size to 16777216 in nextboot file
Setting lgpg_regions to 1025 in nextboot file
Warning: although the change concerns a dynamic tunable, bosboot should be run to optimally restore these settings at reboot
Setting lgpg_size to 16777216
Setting lgpg_regions to 1025
SQL> startup
ORACLE instance started.
Total System Global Area 1.7103E+10 bytes
Fixed Size 2238616 bytes
Variable Size 771753832 bytes
Database Buffers 1.6307E+10 bytes
Redo Buffers 21716992 bytes
Database mounted.
Database opened.
# svmon
size inuse free pin virtual mmode
memory 8060928 5732976 2327952 4683897 5139434 Ded
pg space 2621440 3736
work pers clnt other
pin 4446953 0 0 236944
in use 5139434 0 593542
PageSize PoolSize inuse pgsp pin virtual
s 4 KB - 1096480 3736 309289 502938
m 64 KB - 27381 0 11013 27381
L 16 MB 1025 1025 0 1025 1025
# vmstat -l
System configuration: lcpu=16 mem=31488MB
kthr memory page faults cpu large-page
----- ----------- ------------------------ ------------ ----------- -----------
r b avm fre re pi po fr sr cy in sy cs us sy id wa alp flp
1 1 5139300 2328085 0 0 0 0 0 0 18 1853 568 0 0 99 0 1025 0
从上面的命令可以看出1025个Large Page Memory都被使用了。
--end--