Oracle 安裝時官方建議關閉Linux的透明大頁,防止記憶體延遲分配導致的性能問題 https://docs.oracle.com/cd/E11882_01/install.112/e47689/pre_install.htm#LADBI1519 MOS:ID 1557478.1 Because ...
Oracle 安裝時官方建議關閉Linux的透明大頁,防止記憶體延遲分配導致的性能問題
https://docs.oracle.com/cd/E11882_01/install.112/e47689/pre_install.htm#LADBI1519
MOS:ID 1557478.1
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.
1.查看透明大頁是否啟用
RHEL 6:
# cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
[oracle@rhel 6 ~]$ cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
[always] madvise never
RHEL 7:
# cat /sys/kernel/mm/transparent_hugepage/enabled
[root@rhel 7 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
2.禁用透明大頁
RHEL 6:
(1).編輯/etc/grub.conf 文件,在kernel 那一行後面追加
transparent_hugepage=never
例如:
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux 6 (2.6.32-642.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-642.el6.x86_64 ro root=/dev/mapper/rootvg-lvroot rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_LVM_LV=rootvg/lvswap rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=rootvg/lvroot rd_NO_DM rhgb quiet transparent_hugepage=never
initrd /initramfs-2.6.32-642.el6.x86_64.img
(2).重啟系統生效。
RHEL 7:
(1).編輯/etc/sysconfig/grub 文件,在 GRUB_CMDLINE_LINUX 那一行後面追加 transparent_hugepage=never
例如:
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="crashkernel=auto rd.lvm.lv=rootvg/root rd.lvm.lv=rootvg/swap rhgb quiet transparent_hugepage=never"
GRUB_DISABLE_RECOVERY="true"
(2).再使用 grub2-mkconfig 生成grub.cfg配置文件。
# grub2-mkconfig -o /boot/grub2/grub.cfg
(3).重啟系統使配置生效。