[20170209]理解pre_page_sga参数.txt

简介: [20170209]理解pre_page_sga参数.txt --昨天测试pre_page_sga=true的情况: http://blog.itpub.net/267265/viewspace-2133198/ --//再次看看官方的定义: http://docs.

[20170209]理解pre_page_sga参数.txt

--昨天测试pre_page_sga=true的情况:
http://blog.itpub.net/267265/viewspace-2133198/

--//再次看看官方的定义:
http://docs.oracle.com/cd/E11882_01/server.112/e40402/initparams201.htm#REFRN10174

PRE_PAGE_SGA determines whether Oracle reads the entire SGA into memory at instance startup. Operating system page table
entries are then prebuilt for each page of the SGA. This setting can increase the amount of time necessary for instance
startup, but it is likely to decrease the amount of time necessary for Oracle to reach its full performance capacity
after startup.

Note:

This setting does not prevent your operating system from paging or swapping the SGA after it is initially read into
memory.

PRE_PAGE_SGA can increase the process startup duration, because every process that starts must access every page in the
SGA. The cost of this strategy is fixed; however, you might simply determine that 20,000 pages must be touched every
time a process starts. This approach can be useful with some applications, but not with all applications. Overhead can
be significant if your system frequently creates and destroys processes by, for example, continually logging on and
logging off.

The advantage that PRE_PAGE_SGA can afford depends on page size. For example, if the SGA is 80 MB in size and the page
size is 4 KB, then 20,000 pages must be touched to refresh the SGA (80,000/4 = 20,000).

If the system permits you to set a 4 MB page size, then only 20 pages must be touched to refresh the SGA (80,000/4,000 =
20). The page size is operating system-specific and generally cannot be changed. Some operating systems, however, have a
special implementation for shared memory whereby you can change the page size.

--//按照上面的定义如果我使用hupapage,这样启动数据库时,应该会加载全部页面.还是测试看看:

1.环境:
--//首先修改参数vm.nr_hugepages=600.
# sysctl -p
# sysctl vm.nr_hugepages
vm.nr_hugepages = 600

2.pre_page_sga=false ,使用hugepage的情况:

SYS@book> startup
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
Database mounted.
Database opened.

SYS@book> show parameter pre_page_sga
NAME         TYPE     VALUE
------------ -------- -------
pre_page_sga boolean  FALSE

$ cat /proc/meminfo | grep -i page
AnonPages:        173732 kB
PageTables:        11052 kB
AnonHugePages:     38912 kB
HugePages_Total:     600
HugePages_Free:      393
HugePages_Rsvd:       98
HugePages_Surp:        0
Hugepagesize:       2048 kB

--//alert内存如下:
************************ 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 = 295 (590 MB)
Large Pages configured system wide = 600 (1200 MB)
Large Page size = 2048 KB
********************************************************************

--实际上现在使用600-393=207.
--HugePages_Rsvd:       98
--207+98=305 正好对上. 换一句化将现在还有98页面块没有使用.仅仅使用207块.

--HugePages_Total-HugePages_Free+HugePages_Rsvd 就是 目前实例需要的页面数量.

3.pre_page_sga=true ,使用hugepage的情况:
SYS@book> alter system set pre_page_sga=true scope=spfile ;
System altered.

--//重启数据库.
$ cat /proc/meminfo | grep -i page
AnonPages:        179820 kB
PageTables:        11984 kB
AnonHugePages:     43008 kB
HugePages_Total:     600
HugePages_Free:      295
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB

--//检查alert*.log文件:
************************ 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 = 295 (590 MB)
Large Pages configured system wide = 600 (1200 MB)
Large Page size = 2048 KB
********************************************************************
--//HugePages_Rsvd是0.
--//600-295=305,使用305.

--//也就是pre_page_sga=true的情况下,启动时使用全部sga内存.而不像pre_page_sga=false那样,逐渐加载使用内存.

--//如果设置vm.nr_hugepages = 305,正好使用完,更加好理解,不再测试,留给大家测试.

目录
相关文章
|
小程序
小程序踩坑-appJSON["tabBar"][2]["pagePath"] "pages/test/test" 需在 pages 数组中
小程序踩坑-appJSON["tabBar"][2]["pagePath"] "pages/test/test" 需在 pages 数组中
110 0
|
Unix Linux AI芯片
4.3.3 info page
4.3.3 info page
107 0
|
缓存 Java 关系型数据库
关于page Cache和memory mappped Files 和zero copy
关于page Cache和memory mappped Files 和zero copy
169 0
关于page Cache和memory mappped Files 和zero copy
|
缓存 Linux 存储
从free到page cache
Free 我们经常用free查看服务器的内存使用情况,而free中的输出却有些让人困惑,如下:           图1-1 先看看各个数字的意义以及如何计算得到: free命令输出的第二行(Mem):这行分别显示了物理内存的总量(total)、已使用的 (used)、空闲的(free)、共享的(shared)、buffer(buffer大小)、 cache(cache的大小)的内存。
896 0
|
Oracle 关系型数据库 数据库
[20170516]11G use_large_pages参数2.txt
[20170516]11G use_large_pages参数2.txt //前面我提到如果设置use_large_pages=auto.设置页面大小不足时,oracle会oradism经常修改内核参数vm.
1205 0
|
Oracle 关系型数据库 数据库
[20170313]11G use_large_pages参数.txt
[20170313]11G use_large_pages参数.txt --11G 增加参数use_large_pages,可以灵活使用hugepages. 1.环境: SYS@book> @ &r/ver1 PORT_STRING             ...
1087 0
|
Oracle 关系型数据库 测试技术
[20170208]关于pre_page_sga参数.txt
[20170208]关于pre_page_sga参数.txt --//昨天晚上看链接: https://blogs.oracle.com/Database4CN/entry/%E5%85%B3%E4%BA%8Esys_cpu_usage_100_%E9%97%A...
956 0