[20160517]11G HugePage的使用问题2.txt

简介: [20160517]11G HugePage的使用问题2.txt --昨天测试了HUGEPAGE的使用问题,自己也看了一些文档,从11.2.0.2,加入了参数use_large_pages.

[20160517]11G HugePage的使用问题2.txt

--昨天测试了HUGEPAGE的使用问题,自己也看了一些文档,从11.2.0.2,加入了参数use_large_pages.

SYS@book> @ &r/ver1
PORT_STRING         VERSION        BANNER
------------------- -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

SYS@book> show parameter use_large_pages
NAME            TYPE    VALUE
--------------- ------- -------
use_large_pages string  TRUE

如果参数为True,那么当系统的HugePage被使用尽,只有small pages的情况下,SGA也会继续运行。此时,Oracle实例就运行在内存使用
混合模式(Mixed Mode)下。

如果参数为是Only,从含义上,表示Oracle实例只会使用HugePage作为内存使用。如果系统在AMM模式或者HugePage用尽的时候,数据库
就不能启动或者报错。

如果参数为是false,就不使用HugePage.

--使用HugePage好处多多,特别是现在内存大,连接用户多的情况下优势更加明显.

1.先测试use_large_pages=only的情况.

--我采用手工设置,版本11.2.0.4.

SYS@book> show parameter sga_
NAME          TYPE        VALUE
------------- ----------- -------
sga_max_size  big integer 608M
sga_target    big integer 0

SYS@book> show parameter db_cache_size
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------
db_cache_size                        big integer 408M
SYS@book> show parameter shared_pool_size
NAME                                 TYPE        VALUE
------------------------------------ ----------- -------
shared_pool_size                     big integer 172M

--关闭数据库,设置vm.nr_hugepages = 200.

SYS@book> startup nomount
ORACLE instance started.
Total System Global Area  634732544 bytes
Fixed Size                  2255792 bytes
Variable Size             197133392 bytes
Database Buffers          427819008 bytes
Redo Buffers                7524352 bytes
SYS@book> alter system set use_large_pages=only scope=spfile ;
System altered.

SYS@book> shutdown immediate ;
ORA-01507: database not mounted
ORACLE instance shut down.

SYS@book> startup
ORA-27137: unable to allocate large pages to create a shared memory segment
Linux-x86_64 Error: 12: Cannot allocate memory
Additional information: 624951296
Additional information: 1

--我设置vm.nr_hugepages=200,也就是400M,不够数据库启动,报错.修改参数回来.

2.测试use_large_pages=true的情况.

SYS@book> create pfile='/tmp/a.ora'  from spfile;
File created.

--删除use_large_pages那行.

SYS@book> create spfile from pfile='/tmp/a.ora' ;
File created.

SYS@book> startup nomount
ORACLE instance started.
Total System Global Area  634732544 bytes
Fixed Size                  2255792 bytes
Variable Size             197133392 bytes
Database Buffers          427819008 bytes
Redo Buffers                7524352 bytes

$ cat /proc/meminfo | grep -i huge
AnonHugePages:     18432 kB
HugePages_Total:     200
HugePages_Free:       99
HugePages_Rsvd:       99
HugePages_Surp:        0
Hugepagesize:       2048 kB

************************ Large Pages Information *******************
Per process system memlock (soft) limit = 51 GB

Total Shared Global Region in Large Pages = 400 MB (65%)

Large Pages used by this instance: 200 (400 MB)
Large Pages unused system wide = 0 (0 KB)
Large Pages configured system wide = 200 (400 MB)
Large Page size = 2048 KB

RECOMMENDATION:
  Total System Global Area size is 610 MB. For optimal performance,
  prior to the next instance restart:
  1. Increase the number of unused large pages by
at least 105 (page size 2048 KB, total size 210 MB) system wide to
  get 100% of the System Global Area allocated with large pages
********************************************************************

--仅仅使用400*65/100=260M,提示增加105就ok了.

3.设置更小vm.nr_hugepages=50看看.
# cat /proc/meminfo  | grep huge -i
AnonHugePages:      8192 kB
HugePages_Total:      50
HugePages_Free:       50
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB

SYS@book> startup nomount
ORACLE instance started.
Total System Global Area  634732544 bytes
Fixed Size                  2255792 bytes
Variable Size             197133392 bytes
Database Buffers          427819008 bytes
Redo Buffers                7524352 bytes

$ cat /proc/meminfo | grep -i huge
AnonHugePages:     20480 kB
HugePages_Total:      50
HugePages_Free:       24
HugePages_Rsvd:       24
HugePages_Surp:        0
Hugepagesize:       2048 kB

************************ Large Pages Information *******************
Per process system memlock (soft) limit = 51 GB
Total Shared Global Region in Large Pages = 100 MB (16%)
Large Pages used by this instance: 50 (100 MB)
Large Pages unused system wide = 0 (0 KB)
Large Pages configured system wide = 50 (100 MB)
Large Page size = 2048 KB

RECOMMENDATION:
  Total System Global Area size is 610 MB. For optimal performance,
  prior to the next instance restart:
  1. Increase the number of unused large pages by
at least 255 (page size 2048 KB, total size 510 MB) system wide to
  get 100% of the System Global Area allocated with large pages
********************************************************************

--仅仅使用400*16/100=16M,提示增加255就ok了.

--有了这些提示修改就方便了.修改为vm.nr_hugepages = 305就正好合适.
************************ Large Pages Information *******************
Per process system memlock (soft) limit = 51 GB
Total Shared Global Region in Large Pages = 610 MB (100%)
Large Pages used by this instance: 305 (610 MB)
Large Pages unused system wide = 0 (0 KB)
Large Pages configured system wide = 305 (610 MB)
Large Page size = 2048 KB
********************************************************************

# cat /proc/meminfo  | grep huge -i
AnonHugePages:     26624 kB
HugePages_Total:     305
HugePages_Free:       94
HugePages_Rsvd:       94
HugePages_Surp:        0
Hugepagesize:       2048 kB

--有一些概念还是不清楚,这个的HugePages_Free表示什么,还没用吗?如果在数据库做一些操作HugePages_Free会减少.视乎不受一次分配
--到位的.

# cat /proc/meminfo  | grep huge -i
AnonHugePages:     36864 kB
HugePages_Total:     305
HugePages_Free:       81
HugePages_Rsvd:       81
HugePages_Surp:        0
Hugepagesize:       2048 kB

目录
相关文章
|
Oracle 关系型数据库 Java
Configuring HugePages (Doc ID 1479908.1)
Configuring HugePages (Doc ID 1479908.1)
75 0
|
缓存 Oracle 关系型数据库
[201804012]关于hugepages 3.txt
[201804012]关于hugepages 3.txt --//有一段时间我一直强调安装oracle一定要配置hugepage,因为现在的服务器内存越来越大,如果还使用4K的页面表,如果内存表占用内存巨大, --//特别连接数量很大的情况下,更加明显,结果导致内存紧张,使用交换,这些类似的例子网上很多.
842 0
|
SQL Oracle 关系型数据库
|
前端开发 定位技术 Ruby
|
关系型数据库 Oracle 数据库
[20170927]关于hugepages.txt
[20170927]关于hugepages.txt --//今天测试hugepages与内核参数nr_overcommit_hugepages,才发现HugePages_Surp表示什么? --// [20170209]理解pre_page_sga参数.
972 0
|
Oracle 关系型数据库 数据库
[20170516]11G use_large_pages参数2.txt
[20170516]11G use_large_pages参数2.txt //前面我提到如果设置use_large_pages=auto.设置页面大小不足时,oracle会oradism经常修改内核参数vm.
1173 0
|
Oracle 关系型数据库 数据库
0927hugepages与nr_overcommit_hugepages
[20170927]hugepages与内核参数nr_overcommit_hugepages.txt /proc/sys/vm/nr_overcommit_hugepages specifies how large the pool of huge pages c...
1983 0
|
Oracle 关系型数据库 数据库