<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>惜分飞 &#187; hugetlb_shm_group</title>
	<atom:link href="https://www.xifenfei.com/tag/hugetlb_shm_group/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Thu, 29 Oct 2026 15:31:46 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>Using mlock ulimits for SHM_HUGETLB is deprecated</title>
		<link>https://www.xifenfei.com/2018/03/shm_hugetlb-deprecated.html</link>
		<comments>https://www.xifenfei.com/2018/03/shm_hugetlb-deprecated.html#comments</comments>
		<pubDate>Sun, 11 Mar 2018 04:33:48 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[hugetlb_shm_group]]></category>
		<category><![CDATA[SHM_HUGETLB]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=7330</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2018/03/shm_hugetlb-deprecated.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="xifenfeicopyright">
<p>联系：<a href="https://www.xifenfei.com/about_xifenfei" target="_blank">手机/微信(+86 17813235971)   QQ(107644445)</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&#038;uin=107644445&#038;site=qq&#038;menu=yes"><img src="https://www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"/></a></p>
<p>标题：<a href="https://www.xifenfei.com/2018/03/shm_hugetlb-deprecated.html" target="_blank">Using mlock ulimits for SHM_HUGETLB is deprecated</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>Oracle 数据库运行在linux 6中,启用大页之后,我们经常在/var/log/messages里面会看到类似这样的记录:Mar 11 12:12:33 i-q2ghx82t kernel: oracle (3677): Using mlock ulimits for SHM_HUGETLB is deprecated,我这里的环境也有重现该问题<br />
<strong>环境说明</strong></p>
<pre class="brush: bash; title: ; notranslate">
--系统配置
[root@i-q2ghx82t ~]# more /etc/issue
CentOS release 6.8 (Final)
Kernel \r on an \m

[root@i-q2ghx82t ~]# 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) 128331
max locked memory       (kbytes, -l) 64
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) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 128331
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

[oracle@i-q2ghx82t ~]$ cat /proc/meminfo|grep Hu
AnonHugePages:         0 kB
HugePages_Total:   10752
HugePages_Free:    10752
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB

[root@i-q2ghx82t ~]# more  /proc/sys/vm/hugetlb_shm_group
0

[root@i-q2ghx82t ~]# id oracle
uid=1000(oracle) gid=1000(oinstall) groups=1000(oinstall),1001(dba),1002(oper),1005(asmdba)

--数据库参数
use_large_pages=only
</pre>
<p>在本环境中数据库启动正常,大页也可以正常使用,但是在系统日志中有类似Mar 11 12:12:33 i-q2ghx82t kernel: oracle (3677): Using mlock ulimits for SHM_HUGETLB is deprecated 这样的告警.通过分析,是由于少配置了hugetlb_shm_group参数导致(vm.hugetlb_shm_group 参数设置为有权使用 HugePages 的操作系统组。默认情况下，此参数设置为 0，从而允许所有组使用 HugePages。可以将此参数设置为 Oracle 数据库进程所属的操作系统组，如 oinstall),在本系统中在sysctl.conf中增加vm.hugetlb_shm_group=1000,然后重启系统(测试中,如果只是重启数据库,非系统重启后第一次重启数据库,不会出现该告警),系统日志没有出现相关告警.<br />
<strong>在Linux 6中配置大页建议加上对应的hugetlb_shm_group参数</strong></p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2019/04/linux-limit-wrong-ora-01157.html" rel="bookmark" class="crp_title">linux资源限制导致数据库异常</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/01/liunx%e7%b3%bb%e7%bb%9f%e4%b8%adoracle%e4%bd%bf%e7%94%a8hugepages%e9%85%8d%e7%bd%ae.html" rel="bookmark" class="crp_title">Liunx系统中Oracle使用HugePages配置</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/09/alert-disable-transparent-hugepages-on-sles11-rhel6-oel6-and-uek2-kernels.html" rel="bookmark" class="crp_title">ALERT: Disable Transparent HugePages on SLES11, RHEL6, OEL6 and UEK2 Kernels</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/12/olr%e7%9b%b8%e5%85%b3%e7%bb%b4%e6%8a%a4.html" rel="bookmark" class="crp_title">OLR相关维护</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/06/%e5%9b%a0%e6%9c%aa%e9%85%8d%e7%bd%aehugepage%e4%bc%9a%e8%af%9d%e6%95%b0%e6%b7%bb%e5%a2%9e%e6%82%b2%e5%89%a7%e6%a1%88%e4%be%8b.html" rel="bookmark" class="crp_title">因未配置Hugepage会话数添增悲剧案例</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/04/ocrvote-disk-maintenance-operations-addremovereplacemove.html" rel="bookmark" class="crp_title">OCR/Vote disk 维护操作</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/01/multipath%e5%ae%9e%e7%8e%b0%e8%ae%be%e5%a4%87%e7%94%a8%e6%88%b7%e7%bb%84%e8%ae%be%e7%bd%ae.html" rel="bookmark" class="crp_title">multipath实现设备用户组设置</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/03/redhat-4-%e5%ae%89%e8%a3%8510g.html" rel="bookmark" class="crp_title">redhat 4 安装 Oracle 10g</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2016/08/linux-7-udev.html" rel="bookmark" class="crp_title">linux 7(redhat,oracle linux,centos)中使用udev</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/11/redhat-6-1%e5%ae%89%e8%a3%85oracle-11-2-0-3.html" rel="bookmark" class="crp_title">RedHat 6.1安装Oracle 11.2.0.3</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2016/06/losetup-asm-disk.html" rel="bookmark" class="crp_title">使用losetup实现linux普通文件做asm disk</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2017/07/disable_transparent_hugepages.html" rel="bookmark" class="crp_title">Disable Transparent HugePages</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2018/03/shm_hugetlb-deprecated.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
