<a href="http://blog.51cto.com/181620/1075166">Hugepages你用了嗎?----原理概念篇</a>
------------------------------------
測試目的及意外發現
1. 如何配置Hugepages?
2. Hugepages size是需要大于sga_max_size才生效,還是大于sga_target 就滿足條件呢?
3. AMM在使用的情況下,Hugepages生效嗎?
4. 通過測試,意外發現,在使用Hugepags前後,SGA的共享記憶體在OS系統上是以不同的形态存在的。 根據測試和網絡搜尋,發現/dev/shm是否使用是與AMM相關的,後續再單獨測試并更新一篇部落格
一、 如何配置Hugepages
1. 檢視檔案系統,可以看到共享檔案系統/dev/shm
[root@OEL ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
6.8G 2.7G 3.8G 41% /
/dev/sda1 99M 24M 71M 25% /boot
tmpfs 1.5G 0 1.5G 0% /dev/shm <<<<<<共享記憶體檔案系統
/dev/sdo1 9.9G 7.3G 2.1G 78% /u01
/dev/sr0 2.4G 2.4G 0 100% /media/20120514_120722
2. 檢視目前共享記憶體使用(oracle資料庫啟動前)
[root@OEL ~]# ipcs -m
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 3538944 root 644 80 2
0x00000000 3571713 root 644 16384 2
0x00000000 3604482 root 644 280 2
0x00000000 3670019 root 600 393216 2 dest
0x00000000 3702788 root 600 393216 2 dest
0x00000000 3735557 root 600 393216 2 dest
0x00000000 3768326 root 600 393216 2 dest
0x00000000 3801095 root 600 393216 2 dest
0x00000000 3833864 root 600 393216 2 dest
0x00000000 3866633 root 600 393216 2 dest
0x00000000 3899402 root 600 393216 2 dest
0x00000000 3932171 root 600 393216 2 dest
0x00000000 3964940 root 600 393216 2 dest
3. 檢視目前共享記憶體使用(oracle資料庫啟動後)
[root@OEL ~]# ipcs -a
0x00000000 3964940 root 600 393216 2 dest
0xa3c20e68 4030477 oracle 660 4096 0
0x6010c970 4096014 oracle 660 4096 0
------ Semaphore Arrays --------
key semid owner perms nsems
0x000000a7 0 root 600 1
0x253c0f5c 131073 oracle 660 104
0xf8987fd4 262146 oracle 660 154
tmpfs 1.5G 635M 840M 44% /dev/shm <<<<<已經有共享記憶體被使用
4. 檢視Hugepages,還沒有被使用
[root@OEL ~]# more /proc/meminfo |grep Hug
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
5. 下面開始進行Hugepages的設定和使用
[root@OEL ~]# su - oracle
[oracle@OEL ~]$ sqlplus / as sysdba
SQL> show parameter sga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 800M
sga_target big integer 0
SQL> show parameter shared_pool
shared_pool_reserved_size big integer 7969177
shared_pool_size big integer 0
6. 檢視目前的pmon程序号
[oracle@OEL ~]$ ps -ef|grep pmon
oracle 7267 1 0 10:01 ? 00:00:00 asm_pmon_+ASM
oracle 7426 1 0 10:02 ? 00:00:00 ora_pmon_db
oracle 8703 8593 0 10:25 pts/2 00:00:00 grep pmon
注:pmap指令用于檢查程序,顯示程序空間中的所有映射。每個映射都包括了常駐記憶體空間,是有記憶體空間和共享記憶體空間的數量。這有助于我們估計共享記憶體空間和是有記憶體空間的使用量。
7. 檢視DB使用的記憶體
[oracle@OEL ~]$ pmap 7426
7426: ora_pmon_db
0000000000400000 155140K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle
0000000009d81000 12404K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle
000000000a99e000 280K rwx-- [ anon ]
000000000bfb0000 672K rwx-- [ anon ]
0000000060000000 4K r-xs- /dev/shm/ora_db_4096014_0
0000000060001000 4092K rwxs- /dev/shm/ora_db_4096014_0
0000000060400000 4096K rwxs- /dev/shm/ora_db_4096014_1
......
00007fceb4bf0000 228K rwx-- /dev/zero
00007fceb4c29000 1700K rwx-- [ anon ]
00007fceb4dd2000 40K r-x-- /lib64/libnss_files-2.5.so
00007fceb4ddc000 2044K ----- /lib64/libnss_files-2.5.so
00007fceb4fdb000 4K r-x-- /lib64/libnss_files-2.5.so
00007fceb4fdc000 4K rwx-- /lib64/libnss_files-2.5.so
00007fceb4fed000 416K rwx-- [ anon ]
00007fceb5055000 4K r-x-- /usr/lib64/libaio.so.1.0.1
00007fceb5056000 2044K ----- /usr/lib64/libaio.so.1.0.1
00007fceb5255000 4K rwx-- /usr/lib64/libaio.so.1.0.1
00007fceb5256000 4K rwx-- [ anon ]
00007fceb5257000 444K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libasmclnt11.so
00007fceb687f000 4K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libodmd11.so
00007fceb6880000 8K rwx-- [ anon ]
00007fff1e203000 84K rwx-- [ stack ]
00007fff1e31e000 4K r-x-- [ anon ]
ffffffffff600000 4K r-x-- [ anon ]
total 1037992K
8. 檢視ASM使用的記憶體
[oracle@OEL shm]$ pmap -x 9421
9421: ora_pmon_db
Address Kbytes RSS Dirty Mode Mapping
0000000000400000 155140 11652 0 r-x-- oracle
0000000009d81000 12404 284 80 rwx-- oracle
000000000a99e000 280 184 176 rwx-- [ anon ] <<<<私有程序
000000000aedd000 724 544 544 rwx-- [ anon ]
0000000060000000 718848 0 0 rwxs- SYSV6010c970 (deleted)
00000032f7e00000 112 100 0 r-x-- ld-2.5.so
00007fffc1d58000 84 40 40 rwx-- [ stack ]
00007fffc1d97000 4 4 0 r-x-- [ anon ]
ffffffffff600000 4 0 0 r-x-- [ anon ]
---------------- ------ ------ ------
total kB 933320 15716 2056
注:共享記憶體,該數值合計等于database SGA_MAX,同時可以發現配置設定的共享位址空間是連續的(000000008f800000 ~ 000000008fc00000 )每個大小是4096K, 這裡引出一個問題,為什麼普通的page是4K,這裡顯示的确實4096K?這是由于,oracle database的記憶體最小配置設定機關是granule,這裡是granule size。
9. 查詢DB執行個體的共享記憶體
[oracle@OEL ~]$ pmap 7426|grep sh
0000000060000000 4K r-xs- /dev/shm/ora_db_4096014_0
0000000060001000 4092K rwxs- /dev/shm/ora_db_4096014_0
0000000060400000 4096K rwxs- /dev/shm/ora_db_4096014_1
0000000060800000 4096K rwxs- /dev/shm/ora_db_4096014_2
0000000060c00000 4096K rwxs- /dev/shm/ora_db_4096014_3
0000000061000000 4096K rwxs- /dev/shm/ora_db_4096014_4
......
000000008f800000 4096K rwxs- /dev/shm/ora_db_4096014_190
000000008fc00000 4096K rwxs- /dev/shm/ora_db_4096014_191
0000000090000000 4096K rwxs- /dev/shm/ora_db_4096014_192
0000000090400000 4096K rwxs- /dev/shm/ora_db_4096014_193
0000000090800000 4096K rwxs- /dev/shm/ora_db_4096014_194
0000000090c00000 4096K rwxs- /dev/shm/ora_db_4096014_195
0000000091000000 4096K rwxs- /dev/shm/ora_db_4096014_196
0000000091400000 4096K rwxs- /dev/shm/ora_db_4096014_197
0000000091800000 4096K rwxs- /dev/shm/ora_db_4096014_198
0000000091c00000 4096K rwxs- /dev/shm/ora_db_4096014_199
0000000092000000 4096K rwxs- /dev/shm/ora_db_4096014_200
[oracle@OEL ~]$ pmap 7426|grep sh|wc -l
202
202x4096K=830M正好是SGA的大小
10. 檢視共享記憶體,發現oracle使用者下已經有兩個共享區域了。
[oracle@OEL ~]$ ipcs -m
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 3538944 root 644 80 2
0x00000000 3571713 root 644 16384 2
0x00000000 3604482 root 644 280 2
0xa3c20e68 4030477 oracle 660 4096 0
0x6010c970 4096014 oracle 660 4096 0
二、AMM在使用的情況下,Hugepages生效嗎?
1. 備份spfile,後續需要更改spfile參數,防止更改出錯後恢複
SQL> create pfile='/tmp/liangxx' from spfile;
File created.
SQL> show parameter memory
memory_max_target big integer 800M
memory_target big integer 800M
2. AMM啟用時,hugepages沒有生效
[oracle@OEL ~]$ more /proc/meminfo |grep Hug
HugePages_Total: 700
HugePages_Free: 700
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
3. 檢視共享記憶體
oracle 6438 1 0 16:48 ? 00:00:00 asm_pmon_+ASM
oracle 11376 1 0 18:30 ? 00:00:00 ora_pmon_db
oracle 11908 10931 0 18:42 pts/1 00:00:00 grep pmon
[oracle@OEL ~]$ pmap 11376 |grep sh
0000000060000000 4K r-xs- /dev/shm/ora_db_3833861_0
0000000060001000 4092K rwxs- /dev/shm/ora_db_3833861_0
0000000060400000 4096K rwxs- /dev/shm/ora_db_3833861_1
0000000060800000 4096K rwxs- /dev/shm/ora_db_3833861_2
0000000060c00000 4096K rwxs- /dev/shm/ora_db_3833861_3
0000000061000000 4096K rwxs- /dev/shm/ora_db_3833861_4
0000000061400000 4096K rwxs- /dev/shm/ora_db_3833861_5
0000000061800000 4096K rwxs- /dev/shm/ora_db_3833861_6
0000000061c00000 4096K rwxs- /dev/shm/ora_db_3833861_7
0000000062000000 4096K rwxs- /dev/shm/ora_db_3833861_8
0000000062400000 4096K rwxs- /dev/shm/ora_db_3833861_9
0000000062800000 4096K rwxs- /dev/shm/ora_db_3833861_10
000000006d000000 4096K rwxs- /dev/shm/ora_db_3833861_52
[oracle@OEL ~]$ pmap 11376 |grep sh|wc -l
54
4. 在禁用AMM之後,還需要設定max locked memory值,該值代表系統最大的可配置設定的共享記憶體。
[oracle@OEL ~]$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 23543
max locked memory (kbytes, -l) 64 <<<<<這裡的值設定太小,是以hugepages沒有生效
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 2047
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
5. 在/etc/security/limits.conf中設定以下參數,就是設定max locked memory
[root@OEL ~]# vi /etc/security/limits.conf
* soft memlock 60397977
* hard memlock 60397977
重新開機系統 或者 sysctl -p使設定生效
檢查設定結果
60397977
6. 查詢到Hugepage已經被使用到
[oracle@OEL tmp]$ more /proc/meminfo|grep Hug
HugePages_Free: 548
HugePages_Rsvd: 99
7. 檢視ASM執行個體的SGA是否使用到Hugepage,首先确認是否有設定memory_max_size
[oracle@OEL tmp]$ sqlplus / as sysdba
memory_max_target big integer 272M
memory_target big integer 272M
SQL> create pfile='/tmp/asmxx' from spfile;
SQL> alter system set memory_max_target=0 scope=spfile;
System altered.
SQL> alter system set memory_target=0 scope=spfile;
sga_max_size big integer 272M
SQL> alter system set sga_max_size=500M scope=spfile;
8. SGA設定不正确的值,報錯,通過之前備份的pfile啟動
SQL> startup nomount
ORA-00843: Parameter not taking MEMORY_MAX_TARGET into account
ORA-00849: SGA_TARGET 524288000 cannot be set to more than MEMORY_MAX_TARGET 0.
SQL> exit
Disconnected
注:這裡引出之前介紹的問題,直接alter system set memory_target=0 scope=spfile;是更改不成功的。直接設定為‘0’,以上錯誤。通過建立pfile.ora檔案,然後在檔案裡删除兩個參數"MEMORY_TARGET/MEMORY_MAX_TARGET"。然後再建立spfile就可以了。
9. 查詢memory_max_target,發現沒有設定成功
[oracle@OEL tmp]$ sqlplus / as sysasm
SQL> startup mount pfile='/tmp/asmxx';
memory_max_target big integer 388M
memory_target big integer 0
10. 再次查詢Hugepages确認,隻要AMM使用,Hugepage設定就不會生效
11. 啟動DB執行個體後,由于memory_max_target已經禁用,可以看到Hugepage設定已經生效,
HugePages_Free: 630
HugePages_Rsvd: 181
測試結論,如果使用Hugepages,就必須禁用memory_max_target和memory_target參數。
三、Hugepages size是需要大于sga_max_size才生效,還是大于sga_target 就滿足條件呢?
下面測試,前面有提到hugepages size要大于全部SGA size,但是這裡有個疑問,SGA size是根據sga_max_size還是sga_target呢?下面的測試就會得出結論
1. 設定 sga_max_size =1104M,sga_target=512M
lock_sga boolean FALSE
sga_max_size big integer 1104M
sga_target big integer 512M
2. 查詢确認Hugepages已經被使用
HugePages_Free: 616
HugePages_Rsvd: 469
3. 設定 sga_max_size =1600M,sga_target=512M
SQL> startup nomount pfile='/tmp/liangxx';
sga_max_size big integer 1600M <<<<<<<是否使用Hugepage取決于sga_max_size,而不是sga_target
sga_target big integer 512M
4. 查詢,hugepages沒有生效,
[oracle@OEL ~]$ more /proc/meminfo|grep Hug
5. 設定sga_max_size=700M
sga_max_size big integer 700M
sga_target big integer 500M
6. 發現HugePages又使用上了
HugePages_Rsvd: 199
這裡說明,是否使用hugepages取決于sga_max_size的尺寸,而不是sga_target。
四、問題延伸
1. 通過查詢共享記憶體,引出一個新問題,DB使用了Hugepage後,通過 pmap 8863|grep sh 就不能列出sh的共享值了,而是以/SYSV6010c970 (deleted) 的形式出現。
[oracle@OEL tmp]$ ps -ef|grep pmon
oracle 8464 1 0 19:34 ? 00:00:00 asm_pmon_+ASM
oracle 8863 1 0 19:42 ? 00:00:00 ora_pmon_db
oracle 8957 6753 0 19:43 pts/1 00:00:00 grep pmon
[oracle@OEL tmp]$ pmap 8863|grep sh <<<<<<<在DB使用了Hugepage後,通過ps就不能列出sh的共享值了
[oracle@OEL tmp]$ pmap 8863 <<<<<<<直接列出全部
8863: ora_pmon_db
000000000a99e000 280K rwx-- [ anon ]
000000000b148000 724K rwx-- [ anon ]
0000000060000000 514048K rwxs- /SYSV6010c970 (deleted) <<<<<<<這裡很可疑,因為DB SGA_TARGET就是500M
00000032f7e00000 112K r-x-- /lib64/ld-2.5.so
00000032f801c000 4K r-x-- /lib64/ld-2.5.so
00000032f801d000 4K rwx-- /lib64/ld-2.5.so
00000032f8200000 1340K r-x-- /lib64/libc-2.5.so
00000032f834f000 2044K ----- /lib64/libc-2.5.so
00000032f854e000 16K r-x-- /lib64/libc-2.5.so
00000032f8552000 4K rwx-- /lib64/libc-2.5.so
00000032f8553000 20K rwx-- [ anon ]
00000032f8600000 520K r-x-- /lib64/libm-2.5.so
00000032f8682000 2044K ----- /lib64/libm-2.5.so
00000032f8881000 4K r-x-- /lib64/libm-2.5.so
00000032f8882000 4K rwx-- /lib64/libm-2.5.so
00000032f8e00000 8K r-x-- /lib64/libdl-2.5.so
00000032f8e02000 2048K ----- /lib64/libdl-2.5.so
00000032f9002000 4K r-x-- /lib64/libdl-2.5.so
00000032f9003000 4K rwx-- /lib64/libdl-2.5.so
00000032f9200000 88K r-x-- /lib64/libpthread-2.5.so
00000032f9216000 2044K ----- /lib64/libpthread-2.5.so
00000032f9415000 4K r-x-- /lib64/libpthread-2.5.so
00000032f9416000 4K rwx-- /lib64/libpthread-2.5.so
00000032f9417000 16K rwx-- [ anon ]
00000032f9600000 28K r-x-- /lib64/librt-2.5.so
00000032f9607000 2048K ----- /lib64/librt-2.5.so
00000032f9807000 4K r-x-- /lib64/librt-2.5.so
00000032f9808000 4K rwx-- /lib64/librt-2.5.so
00000032fbe00000 84K r-x-- /lib64/libnsl-2.5.so
00000032fbe15000 2044K ----- /lib64/libnsl-2.5.so
00000032fc014000 4K r-x-- /lib64/libnsl-2.5.so
00000032fc015000 4K rwx-- /lib64/libnsl-2.5.so
00000032fc016000 8K rwx-- [ anon ]
00007faf908ab000 912K rwx-- [ anon ]
00007faf9098f000 40K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libnque11.so
00007faf90999000 1020K ----- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libnque11.so
00007faf90a98000 4K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libnque11.so
00007faf90a99000 4K rwx-- [ anon ]
00007faf90a9a000 88K rwx-- /dev/zero
00007faf90ab0000 64K rwx-- /dev/zero
00007faf90ac0000 64K rwx-- /dev/zero
00007faf90ad0000 64K rwx-- /dev/zero
00007faf90ae0000 64K rwx-- /dev/zero
00007faf90af0000 168K rwx-- /dev/zero
00007faf90b1a000 1700K rwx-- [ anon ]
00007faf90cc3000 40K r-x-- /lib64/libnss_files-2.5.so
00007faf90ccd000 2044K ----- /lib64/libnss_files-2.5.so
00007faf90ecc000 4K r-x-- /lib64/libnss_files-2.5.so
00007faf90ecd000 4K rwx-- /lib64/libnss_files-2.5.so
00007faf90ece000 272K rwx-- [ anon ]
00007faf90f12000 4K r-x-- /usr/lib64/libaio.so.1.0.1
00007faf90f13000 2044K ----- /usr/lib64/libaio.so.1.0.1
00007faf91112000 4K rwx-- /usr/lib64/libaio.so.1.0.1
00007faf91113000 4K rwx-- [ anon ]
00007faf91114000 444K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libasmclnt11.so
00007faf91183000 1024K ----- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libasmclnt11.so
00007faf91283000 72K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libasmclnt11.so
00007faf91295000 4K rwx-- [ anon ]
00007faf91296000 44K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libocrutl11.so
00007faf912a1000 1020K ----- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libocrutl11.so
00007faf913a0000 4K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libocrutl11.so
00007faf913a1000 608K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libocrb11.so
00007faf91439000 1024K ----- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libocrb11.so
00007faf91539000 8K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libocrb11.so
00007faf9153b000 4K rwx-- [ anon ]
00007faf9153c000 612K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libocr11.so
00007faf915d5000 1020K ----- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libocr11.so
00007faf916d4000 8K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libocr11.so
00007faf916d6000 8K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libskgxn2.so
00007faf916d8000 1020K ----- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libskgxn2.so
00007faf917d7000 4K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libskgxn2.so
00007faf917d8000 4256K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libhasgen11.so
00007faf91c00000 1024K ----- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libhasgen11.so
00007faf91d00000 72K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libhasgen11.so
00007faf91d12000 20K rwx-- [ anon ]
00007faf91d17000 136K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libdbcfg11.so
00007faf91d39000 1020K ----- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libdbcfg11.so
00007faf91e38000 8K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libdbcfg11.so
00007faf91e3a000 92K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclsra11.so
00007faf91e51000 1024K ----- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclsra11.so
00007faf91f51000 4K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclsra11.so
00007faf91f52000 2580K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.so
00007faf921d7000 1020K ----- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.so
00007faf922d6000 268K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.so
00007faf92319000 8K rwx-- [ anon ]
00007faf92326000 4K rwxs- /u01/app/oracle/product/11.2.0/dbhome_1/dbs/hc_db.dat
00007faf92327000 16K rwx-- [ anon ]
00007faf9232b000 732K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libskgxp11.so
00007faf923e2000 1024K ----- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libskgxp11.so
00007faf924e2000 8K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libskgxp11.so
00007faf924e4000 316K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libcell11.so
00007faf92533000 1020K ----- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libcell11.so
00007faf92632000 32K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libcell11.so
00007faf9263a000 4K rwx-- [ anon ]
00007faf9263b000 4K r-x-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libodmd11.so
00007faf9263c000 1024K ----- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libodmd11.so
00007faf9273c000 4K rwx-- /u01/app/oracle/product/11.2.0/dbhome_1/lib/libodmd11.so
00007faf9273d000 8K rwx-- [ anon ]
00007fff37756000 84K rwx-- [ stack ]
00007fff377ff000 4K r-x-- [ anon ]
total 728520K
2. 檢視檔案系統,/dev/shm有被使用
[oracle@OEL ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
6.8G 2.7G 3.8G 41% /
/dev/sda1 99M 24M 71M 25% /boot
tmpfs 1.5G 75M 1.4G 6% /dev/shm
/dev/sdo1 9.9G 7.3G 2.1G 79% /u01
3. 這裡發現另外一個不同的地方,就是oracle使用者的bytes值
[oracle@OEL shm]$ ipcs -m
0xa3c20e68 4030468 oracle 660 4096 0 <<<<<<<<<<<ASM執行個體沒有使用Hugepage,還是4096,同時也 能通過pmap查詢到
0x6010c970 4390917 oracle 660 736100352 20 <<<<<<<<<<<在不是用Hugepage的時候,這裡是4096,但是現在 顯示的實際的值
通過測試,意外發現,在使用Hugepags前後,SGA的共享記憶體在OS系統上是以不同的形态存在的。經過網絡搜尋,發現/dev/shm是否使用是與AMM相關的,後續再單獨測試并更新一篇部落格
本文轉自 hsbxxl 51CTO部落格,原文連結:http://blog.51cto.com/hsbxxl/1076712,如需轉載請自行聯系原作者