[20191202]關於hugepages相關問題.txt
[20191202]關於hugepages相關問題.txt
--//上午在測試hugepages相關問題時遇到一個問題,自己以前疏忽了,就是在use_large_pages=true的情況下.
--//如果在/etc/sysctl.conf引數檔案中vm.nr_hugepages定義不夠大,即使定義vm.nr_overcommit_hugepages足夠.
--//也不會向vm.nr_overcommit_hugepages借用記憶體,導致進入混合模式.
--//透過例子說明:
1.環境:
SCOTT@book> @ 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
SCOTT@book> alter system set use_large_pages=true scope=spfile;
System altered.
# grep "^vm.nr" /etc/sysctl.conf
vm.nr_hugepages = 104
vm.nr_overcommit_hugepages = 1000
# sysctl -p
2.測試:
--//重啟資料庫看看,檢查alert檔案發現:
Adjusting the default value of parameter parallel_max_servers
from 480 to 170 due to the value of parameter processes (200)
Starting ORACLE instance (normal)
************************ Large Pages Information *******************
Per process system memlock (soft) limit = 51 GB
Total Shared Global Region in Large Pages = 208 MB (33%)
Large Pages used by this instance: 104 (208 MB)
Large Pages unused system wide = 0 (0 KB)
Large Pages configured system wide = 104 (208 MB)
Large Page size = 2048 KB
RECOMMENDATION:
Total System Global Area size is 618 MB. For optimal performance,
prior to the next instance restart:
1. Increase the number of unused large pages by
at least 205 (page size 2048 KB, total size 410 MB) system wide to
get 100% of the System Global Area allocated with large pages
********************************************************************
--//可以發現僅僅使用定義vm.nr_hugepages = 104.
$ grep -i page /proc/meminfo
AnonPages: 165700 kB
PageTables: 18904 kB
AnonHugePages: 0 kB
HugePages_Total: 104
HugePages_Free: 49
HugePages_Rsvd: 49
HugePages_Surp: 0
Hugepagesize: 2048 kB
$ ps -ef | grep pmo[n] | awk '{print $2}' | xargs -IQ grep SYSV /proc/Q/numa_maps
60000000 default file=/SYSV00000000\040(deleted) huge dirty=1 mapmax=25 N0=1
60c00000 default file=/SYSV00000000\040(deleted) huge
6a400000 default file=/SYSV00000000\040(deleted) huge
6c400000 default file=/SYSV00000000\040(deleted) huge
6cc00000 default file=/SYSV00000000\040(deleted) huge
--//僅僅5個共享記憶體段使用hugepages.
6d000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=785 mapmax=25 active=245 N0=400 N1=385
86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
$ sysresv
IPC Resources for ORACLE_SID "book" :
Shared Memory:
ID KEY
413040641 0x00000000
413073410 0x00000000
413106179 0x00000000
413138949 0x00000000
413171718 0x00000000
413204487 0x00000000
413237256 0xe8a8ec10
Semaphores:
ID KEY
335151104 0x6aa88594
Oracle Instance alive for sid "book"
--//也就是在use_large_pages=true的情況下不會向vm.nr_overcommit_hugepages引數借用記憶體.
3.測試:
SYS@book> alter system set use_large_pages=only scope=spfile;
System altered.
# grep "^vm.nr" /etc/sysctl.conf
vm.nr_hugepages = 104
vm.nr_overcommit_hugepages = 204
# sysctl -p
..
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: 2097152
--//104+204 = 308,還不夠大.
# grep "^vm.nr" /etc/sysctl.conf
vm.nr_hugepages = 104
vm.nr_overcommit_hugepages = 1000
# sysctl -p
..
SYS@book> startup
ORACLE instance started.
Total System Global Area 643084288 bytes
Fixed Size 2255872 bytes
Variable Size 205521920 bytes
Database Buffers 427819008 bytes
Redo Buffers 7487488 bytes
Database mounted.
Database opened.
--//alert輸出如下:
Adjusting the default value of parameter parallel_max_servers
from 480 to 170 due to the value of parameter processes (200)
Starting ORACLE instance (normal)
************************ Large Pages Information *******************
Parameter use_large_pages = ONLY
Per process system memlock (soft) limit = 51 GB
Large Pages unused system wide = 308 (616 MB)
Large Pages configured system wide = 308 (616 MB)
Large Page size = 2048 KB
ERROR:
Failed to allocate shared global region with large pages, unix errno = 12.
Aborting Instance startup.
ORA-27137: unable to allocate Large Pages to create a shared memory segment
ACTION:
Total System Global Area size is 624 MB. Prior to next instance restart:
1. Increase the number of unused large pages (page size 2048 KB)
to at least 312 (624 MB) to allocate 100% System Global Area
with large pages.
********************************************************************
--//以上是報ORA-27137的情況.
Mon Dec 02 15:59:56 2019
Adjusting the default value of parameter parallel_max_servers
from 480 to 170 due to the value of parameter processes (200)
Starting ORACLE instance (normal)
************************ Large Pages Information *******************
Parameter use_large_pages = ONLY
Per process system memlock (soft) limit = 51 GB
Total Shared Global Region in Large Pages = 618 MB (100%)
Large Pages used by this instance: 309 (618 MB)
Large Pages unused system wide = 0 (0 KB)
Large Pages configured system wide = 309 (618 MB)
Large Page size = 2048 KB
********************************************************************
$ ps -ef | grep pmo[n] | awk '{print $2}' | xargs -IQ grep SYSV /proc/Q/numa_maps
60000000 default file=/SYSV00000000\040(deleted) huge dirty=1 mapmax=25 N0=1
60c00000 default file=/SYSV00000000\040(deleted) huge dirty=37 mapmax=25 N0=30 N1=7
86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) huge dirty=1 mapmax=25 N0=1
$ sysresv
IPC Resources for ORACLE_SID "book" :
Shared Memory:
ID KEY
413401089 0x00000000
413433858 0x00000000
413466627 0xe8a8ec10
Semaphores:
ID KEY
335314944 0x6aa88594
Oracle Instance alive for sid "book"
3.總結:
--//設定核心引數vm.nr_overcommit_hugepages ,僅僅在use_large_pages=only的情況下才會有效.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2666518/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20191202]關於oracle例項是否使用hugepages問題.txtOracle
- [20191129]關於hugepages的問題.txt
- [201804012]關於hugepages 3.txt
- [20191204]關於oracle例項是否使用hugepages問題2.txtOracle
- [20191220]關於共享記憶體段相關問題.txt記憶體
- [20191223]關於共享記憶體段相關問題3.txt記憶體
- 關於 go-micro 相關問題Go
- 關於盒模型相關的問題模型
- [20190108]rlwrap sqlplus tee相關問題.txtSQL
- [20180413]熱備模式相關問題.txt模式
- [20181123]關於降序索引問題.txt索引
- [20180403]關於時區問題.txt
- [20201210]11G ACS相關問題.txt
- [20190110]rlwrap sqlplus tee相關問題3.txtSQL
- [20180413]熱備模式相關問題2.txt模式
- [20230317]關於TIME_WAIT問題.txtAI
- [20210520]關於主鍵索引問題.txt索引
- [20190918]關於函式索引問題.txt函式索引
- [20181229]關於字串的分配問題.txt字串
- [20221125]設定hugepages遇到的問題.txt
- win10 下關於redis的相關問題Win10Redis
- [20230306]學習UNIFIED audit--dg相關問題.txtNifi
- [20190929]bash使用bc計算的相關問題.txt
- [20190910]關於降序索引問題5.txt索引
- [20211220]關於標量子查詢問題.txt
- [20200711]關於左右連線的問題.txt
- [20200416]關於軟軟解析的問題.txt
- [20181124]關於降序索引問題4.txt索引
- [20181124]關於降序索引問題3.txt索引
- [20181124]關於降序索引問題2.txt索引
- electron相關問題
- django相關問題Django
- Docker 相關問題Docker
- octomap相關問題
- [20211018]運維中關於history的問題.txt運維
- [20190603]關於dbms_output輸出問題.txt
- 大模型相關問題大模型
- python pip相關問題Python