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

简介: [20160516]11G HugePage的使用问题.txt --我们的dg内存不足,配置的/etc/sysctl.conf如下: vm.nr_hugepages = 3200 --没有启动数据库前如下: # grep -i huge /proc/memi...

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

--我们的dg内存不足,配置的/etc/sysctl.conf如下:
vm.nr_hugepages = 3200

--没有启动数据库前如下:

# grep -i huge /proc/meminfo
AnonHugePages:     14336 kB
HugePages_Total:    3200
HugePages_Free:     3200
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB

--3200*2=6400M,也就是配置了6G上下给HugePAGE,而我们数据库原来的参数很大,达到SGA_TAGGET=76G,正常不会HUPEGE.

--启动数据库后:

SYS@dbcn1> startup open read only
ORACLE instance started.
Total System Global Area 8.0973E+10 bytes
Fixed Size                  2261968 bytes
Variable Size            9932114992 bytes
Database Buffers         7.0867E+10 bytes
Redo Buffers              171487232 bytes
Database mounted.
Database opened.

SYS@dbcn1> show parameter sga_
NAME          TYPE         VALUE
------------- ------------ --------
sga_max_size  big integer  77568M
sga_target    big integer  77568M


# grep -i huge /proc/meminfo
AnonHugePages:     26624 kB
HugePages_Total:    3200
HugePages_Free:     3003
HugePages_Rsvd:     3003
HugePages_Surp:        0
Hugepagesize:       2048 kB

--你可以发现依旧使用HUGEPAGE.检查alert*.log文件:

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

Total Shared Global Region in Large Pages = 6400 MB (8%)

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

RECOMMENDATION:
  Total System Global Area size is 76 GB. For optimal performance,
  prior to the next instance restart:
  1. Increase the number of unused large pages by
at least 35585 (page size 2048 KB, total size 70 GB) system wide to
  get 100% of the System Global Area allocated with large pages
  2. Large pages are automatically locked into physical memory.
Increase the per process memlock (soft) limit to at least 76 GB to lock
100% System Global Area's large pages into physical memory
********************************************************************


--换一句话讲及时即使你配置不足,oracle也会使用它.不知道从那个版本开始支持这个特性.

这个情况在11.2.0.3版本中有一些变化。Oracle首先会使用可用的HugePage,如果使用尽了,同样会采用剩下的small pages作为SGA使用
。变化在于对使用HugePage的方式上,根据官方的说法:

With this new behavior additional shared memory segments are an expected side effect. Part of the change is to ensure
that each shared memory segment making up the SGA only contains sub-areas with an identical alignment requirement -
hence the SGA will spread over more separate SHM segments. In this supported mixed page mode the database will exhaust
the available hugepages, before switching to regular sized pages.

--另外必须注意一个问题,如果设置不用这些内存不用就浪费了.
--假设设置
vm.nr_hugepages = 26000

# free -m
             total       used       free     shared    buffers     cached
Mem:        129161      41066      88094          0        892      31060
-/+ buffers/cache:       9113     120047
Swap:        30718          0      30718

# sysctl -p

# free -m
             total       used       free     shared    buffers     cached
Mem:        129161      86665      42495          0        892      31060
-/+ buffers/cache:      54713      74448
Swap:        30718          0      30718

--内存马上使用45G,free也减少了.这个在配置时注意,假设你设置了以上参数,数据库又没有重启,这样不会使用hugepage,双重内存使用,内存很快会耗尽.

目录
相关文章
|
Oracle 关系型数据库 Java
Configuring HugePages (Doc ID 1479908.1)
Configuring HugePages (Doc ID 1479908.1)
76 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 关系型数据库 数据库