一、为何要关闭透明大页

A--MOS获取 .

#翻译
由于透明超大页面已知会导致意外的节点重新启动并导致RAC出现性能问题,因此Oracle强烈建议禁用透明超大页面。
另外,即使在单实例数据库环境中,透明超大页面也可能会导致问题,并出现意外的性能问题或延迟。
因此,Oracle建议在运行Oracle的所有数据库服务器上禁用透明超大页面 #原版: Because Transparent HugePages are known to cause unexpected node reboots
and performance problems with RAC, Oracle strongly advises to disable
the use of Transparent HugePages. In addition, Transparent Hugepages
may cause problems even in a single-instance database environment with
unexpected performance problems or delays. As such, Oracle recommends
disabling Transparent HugePages on all Database servers running Oracle

B--https://blog.csdn.net/wzx19840423/article/details/53667809 --博客截取

透明大页块:可以动态将系统默认内存叶块4kb,交换为Huge pages,在这个过程中,对于操作系统的内存的各种分配活动,都需要各种内存锁,直接影响程序的内存访问性能,
这个过程对应用是透明的,在应用层面不可控制,对于专门优化4K page优化的程序来说,造成随机的性能下降问题。 Transparent Huge Pages (THP) are enabled by default in RHEL 6 for all applications. The kernel attempts to allocate
hugepages whenever possible and any Linux process will receive 2MB pages if the mmap region is 2MB naturally aligned.
The main kernel address space itself is mapped with hugepages, reducing TLB pressure from kernel code. For general
information on Hugepages, see: What are Huge Pages and what are the advantages of using them? The kernel will always attempt to satisfy a memory allocation using hugepages. If no hugepages are available
(due to non availability of physically continuous memory for example) the kernel will fall back to the regular 4KB pages.
THP are also swappable (unlike hugetlbfs). This is achieved by breaking the huge page to smaller 4KB pages,
which are then swapped out normally. But to use hugepages effectively, the kernel must find physically continuous areas of memory big enough to satisfy the request,
and also properly aligned. For this, a khugepaged kernel thread has been added. This thread will occasionally
attempt to substitute smaller pages being used currently with a hugepage allocation, thus maximizing THP usage. In userland, no modifications to the applications are necessary (hence transparent). But there are ways to optimize its use.
For applications that want to use hugepages, use of posix_memalign() can also help ensure that large allocations are
aligned to huge page (2MB) boundaries. Also, THP is only enabled for anonymous memory regions. There are plans to add support for tmpfs and page cache.
THP tunables are found in the /sys tree under /sys/kernel/mm/redhat_transparent_hugepage.

--博客链接--描述配置大页的好处

https://blog.csdn.net/g__hk/article/details/44955587

1.页表数量减少

2.sga不会存在内存交换


二、禁用透明大页区在哪?
从RedHat6,OL6,SLES11和UEK2内核开始,实现并启用透明超大页面(默认)以尝试改进内存管理。
透明HugePages类似于以前Linux版本中可用的HugePages。主要区别在于透明HugePages是在运行时由内核中的khugepaged线程动态设置的,
而常规的HugePages必须在启动时预先分配
#禁用后,内存大页将在系统启动后初始化分配,内存大页不会动态调整 三、关闭透明大页步骤:
可以参考MOS文档:

ALERT: Disable Transparent HugePages on SLES11, RHEL6, RHEL7, OL6, OL7, and UEK2 and above (Doc ID 1557478.1)

Oracle Linux 7 - How to disable Transparent HugePages for RHCK kernel? (Doc ID 2066217.1)

系统版本:

#CentOS release 6.9

[root@bogon data]# lsb_release -a

Description:    CentOS release 6.9 (Final)

Release:        6.9

# cp /etc/grub.conf /etc/grub.conf.bak

# vi /etc/grub.conf   本次配置

#boot=/dev/sda
default=1 #解释说明,默认系统启动,使用标题,引导序列1
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (4.4.132-1.el6.elrepo.x86_64) --引导,启动序列0
root (hd0,0)
kernel /boot/vmlinuz-4.4.132-1.el6.elrepo.x86_64 ro
root=UUID=e1c11d33-6775-4772-966a-1575e1660833 rd_NO_LUKS
KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto
LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet transparent_hugepage=never--可以不修改
initrd /boot/initramfs-4.4.132-1.el6.elrepo.x86_64.img
title CentOS (2.6.32-696.28.1.el6.x86_64) --引导,启动序列1
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-696.28.1.el6.x86_64 ro #内核---参数
root=UUID=e1c11d33-6775-4772-966a-1575e1660833 rd_NO_LUKS
KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto
LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet transparent_hugepage=never 修改
initrd /boot/initramfs-2.6.32-696.28.1.el6.x86_64.img --初始化
【在quiet之后,空格加上transparent_hugepage=never,博客发出去有换行,修改请注意】


#LINUX 7

[root@bdp04 ~]# cat /proc/version
Linux version 3.10.0-693.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) )
#1 SMP Tue Aug 22 21:09:27 UTC 2017
# [root@bdp04 etc]# cd /etc/default/ [root@bdp04 default]# cp grub grub_bak_180508 [root@bdp04 default]# vi grub GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet transparent_hugepage=never" GRUB_DISABLE_RECOVERY="true" 生效配置 [root@bdp04 default]# cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg_bak180508 [root@bdp04 default]# grub2-mkconfig -o /boot/grub2/grub.cfg
Linux7 第二种方式
在/etc/rc.local中加入如下两行--先备份,修改后重启系统
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi 请相应地将RHEL内核的文件路径更改为/ sys / kernel / mm / redhat_transparent_hugepage /

  


四、验证查询是否关闭:配置重启系统后

#A,认为最简单方便的:查询大页配置

oracle@bdp04 ~]$ grep Huge /proc/meminfo

AnonHugePages:         0 kB  与透明大页有关,透明大页关闭,则显示0

HugePages_Total:   65560      大页总数量

HugePages_Free:    65560

HugePages_Rsvd:        0

HugePages_Surp:        0

Hugepagesize:       2048 kB

[https://toutiao.io/posts/n4hzg1/preview 可获得AnonHugePages 解释说明

#B  【never】

[root@testhost ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]

Linux关闭透明大页配置的更多相关文章

  1. linux关闭透明大页

    echo never > /sys/kernel/mm/transparent_hugepage/enabled echo never > /sys/kernel/mm/transpare ...

  2. oracle之 关闭透明大页

    方法一: 1.设置/etc/grub.conf文件,添加 transparent_hugepage=never ,在系统启动是禁用 [root@hbdw1 ~]# cat /etc/grub.conf ...

  3. redhat linux 7.4关闭透明大页

    每一步: 在GRUB_CMDLINE_LINUX加入选项 transparent_hugepage=never echo 'GRUB_CMDLINE_LINUX="transparent_h ...

  4. 禁用Linux透明大页

    Oracle 安装时官方建议关闭Linux的透明大页,防止内存延迟分配导致的性能问题 https://docs.oracle.com/cd/E11882_01/install.112/e47689/p ...

  5. Transparent HugePages(透明大页)

    Transparent HugePages(透明大页) 1. 介绍 从RedHat6, RedHat7, OL6, OL7 SLES11 and UEK2 kernels开始,透明大页默认是被开启的以 ...

  6. 大页(huge pages) 三大系列 ---计算大页配置参数

    使用以下shell 脚本来计算大页配置参数,确保使用脚本实例之前的数据已经开始, 如果数据库的版本号11g,确认是否使用自己主动的内存管理(AMM) +++++++++++++++++++++++++ ...

  7. Linux HugePages及MySQL 大页配置

    http://blog.csdn.net/dba_waterbin/article/details/9669929       ㈠ HugePages简介             HugePages是 ...

  8. Linux 之 hugepage 大页内存理论

    HugePages是通过使用大页内存来取代传统的4kb内存页面,使得管理虚拟地址数变少,加快了从虚拟地址到物理地址的映射以及通过摒弃内存页面的换入换出以提高内存的整体性能.尤其是对于8GB以上的内存以 ...

  9. 关闭centos大页及swappiness

    首先检查THP的启用状态: [root@localhost ~]# cat /sys/kernel/mm/transparent_hugepage/defrag [always] madvise ne ...

随机推荐

  1. git相关知识(github,idea等的配置)

    本地git提交文件到github上: 1.在github上创建项目 2.使用git clone https://github.com/xxxxxxx/xxxxx.git克隆到本地 3.编辑项目 4.g ...

  2. Convex Fence

    Convex Fence I have a land consisting of n trees. Since the trees are favorites to cows, I have a bi ...

  3. servlet/和/*匹配的区别

    两者真正的区别是,两者的长度不同,根据最长路径匹配的优先级,/*比/更容易被选中,而/的真正含义是,缺省匹配.既所有的URL都无法被选中的时候,就一定会选中/,可见它的优先级是最低的,这就两者的区别.

  4. linux网络操作 ifconfig命令

    ifconfig 查看已经被激活的网卡详细信息 "ifconfig eth0" 查看特定的网卡信息 [root@ssgao ~]# ifconfig eth0 eth0 Link ...

  5. Linux的安装包命令/yum 与 Rpm

    1.Rpm安装包命令(以dhcp软件包为例)----Rpm安装软件包需要解决依赖性,因此特别麻烦(如图2被需要). rpm与yum安装的均为二进制软件包.类似于windows下载的软件包,可直接安装使 ...

  6. net资源1

    .net core 例子 https://github.com/aspnet/Docs/tree/master/aspnetcore/fundamentals C#中使用Spire.docx操作Wor ...

  7. 读书笔记 C# 接口中的索引器之浅析

    在C#中,可以在类.结构或接口中用this关键字声明索引器,在索引器内部用get或set访问器访问类中集合的某项值.因此可以将索引器看作是类的属性一样去定义.索引器常用定义格式如下: public i ...

  8. MyEclipse使用教程:在Web项目中使用Web片段

    MyEclipse 在线订购年终抄底促销!火爆开抢>> MyEclipse最新版下载 本教程向用户展示了使用关联的Web项目创建Web片段项目的机制.用户还可以获得要检查的示例项目.在本教 ...

  9. 实力封装:Unity打包AssetBundle(四)

    →→前情提要:窗口初现←← 让用户选择要打包的文件 时至今日,我们选择打包文件的方式依然是在Project面板或Hierarchy面板中用鼠标点选.现在既然有了窗口,我们自然希望可以将所有文件罗列在窗 ...

  10. 设置table中的td一连串内容自动换行

    遇到一长串字母撑出了td宽度,导致整个表格错乱,如图: , 解决办法: 第一: table 加上css: table-layout: fixed;(此css属性 表示 列宽由表格宽度和列宽度设定.不会 ...