Disable Transparent HugePages in Oracle Linux 7

Source: Internet
Author: User

Disable Transparent HugePages in Oracle Linux 7

Earlier versions of Oracle Linux Unbreakable Enterprise Kernel2 (UEK2) in Red Hat Enterprise Linux 6, SUSE 11, and Oracle Linux 6 in Transparent HugePages are enabled by default. In Transparent HugePages, the Oracle Linux Unbreakable Enterprise Kernel2 (UEK2) kernel is disabled by default. "Tuned. service" in Oracle Linux7, transparent_hugepage is set to always by default. Even if it is disabled in the grub kernel command line, the tuned service will be set to 'alway' during boot '. UEK3 is disabled by default.

Transparent HugePages may cause delayed allocation during running. To avoid performance problems, we strongly recommend that you disable Transparent HugePages for all Oracle database servers. Standard HugePages is recommended for Oracle to improve performance.

The difference between the Transparent HugePages memory and the standard HugePages memory is that the kernel khugepaged thread dynamically allocates memory during runtime. The standard HugePages memory is pre-allocated at startup and will not change at runtime.
1. Check whether Transparent HugePage is enabled
[Root @ oracle12c ~] # Uname-r
3.10.0-123. el7.x86 _ 64
[Root @ oracle12c ~] # Cat/sys/kernel/mm/transparent_hugepage/enabled
[Always] madvise never --- this indicates that Transparent Hugepage is enabled

2. There are two ways to disable Transparent HugePage
2.1 disable Transparent HugePage globally for throughput performance
First, back up the file/usr/lib/tuned/throughput-performance/tuned. conf.
[Root @ oracle12c ~] # Ls-lrt/usr/lib/tuned/throughput-performance/tuned. conf *
-Rw-r --. 1 root 2050 May 7 2014/usr/lib/tuned/throughput-performance/tuned. conf
-Rw-r --. 1 root 2050 Mar 29 :04/usr/lib/tuned/throughput-performance/tuned. conf. bkp

[Root @ oracle12c ~] # More/usr/lib/tuned/throughput-performance/tuned. conf | grep "transparent_hugepages"
Transparent_hugepages = always

Modify the/usr/lib/tuned/throughput-performance/tuned. conf file
[Vm]
Transparent_hugepages = always
Change
[Vm]
Transparent_hugepages = never
[Root @ oracle12c ~] # More/usr/lib/tuned/throughput-performance/tuned. conf | grep "transparent_hugepages"
Transparent_hugepages = never

Restart the operating system to verify the Modification result.
[Root @ oracle12c ~] # Uname-r
3.10.0-123. el7.x86 _ 64
[Root @ oracle12c ~] # Cat/sys/kernel/mm/transparent_hugepage/enabled
Always madvise [never]

2. Disable Transparent HugePage for the currently used adjustment Profile
First identify the used adjustment Profile
[Root @ oracle12c ~] # Tuned-adm active
Current active profile: virtual-guest -- this indicates that the currently used profile is Virtual-guest

Virtual-guest profile uses the file/usr/lib/tuned/virtual-guest/tuned. conf, and it contains the file/usr/lib/tuned/throughput-performance/tuned. "throughput-performance" in conf ". First, back up the file/usr/lib/tuned/virtual-guest/tuned. conf.
[Root @ oracle12c ~] # Cp/usr/lib/tuned/virtual-guest/tuned. conf/usr/lib/tuned/virtual-guest/tuned. conf. bkp
[Root @ oracle12c ~] # Ls-lrt/usr/lib/tuned/virtual-guest/tuned. conf *
-Rw-r --. 1 root 697 Nov 6 2013/usr/lib/tuned/virtual-guest/tuned. conf
-Rw-r --. 1 root 697 Mar 29/usr/lib/tuned/virtual-guest/tuned. conf. bkp

[Root @ oracle12c ~] # More/usr/lib/tuned/virtual-guest/tuned. conf
#
# Tuned configuration
#

[Main]
Include = throughput-performance

[Sysctl]
# If a workload mostly uses anonymous memory and it hits this limit, the entire
# Working set is buffered for I/O, and any more write buffering wowould require
# Swapping, so it's time to throttle writes until I/O can catch up. Workloads
# That mostly use file mappings may be able to use even higher values.
#
# The generator of dirty data starts writeback at this percentage (system default
# It is 20%)
Vm. dirty_ratio = 30

# Filesystem I/O is usually much more efficient than swapping, so try to keep
# Swapping low. It's usually safe to go even lower than this on systems
# Server-grade storage.
Vm. swappiness = 30

Add "transparent_hugepages = never" to the/usr/lib/tuned/virtual-guest/tuned. conf file to disable it.
Transparent HugePage
[Root @ oracle12c ~] # Vi/usr/lib/tuned/virtual-guest/tuned. conf
#
# Tuned configuration
#

[Main]
Include = throughput-performance
[Vm]
Transparent_hugepages = never
[Sysctl]
# If a workload mostly uses anonymous memory and it hits this limit, the entire
# Working set is buffered for I/O, and any more write buffering wowould require
# Swapping, so it's time to throttle writes until I/O can catch up. Workloads
# That mostly use file mappings may be able to use even higher values.
#
# The generator of dirty data starts writeback at this percentage (system default
# It is 20%)
Vm. dirty_ratio = 30

# Filesystem I/O is usually much more efficient than swapping, so try to keep
# Swapping low. It's usually safe to go even lower than this on systems
# Server-grade storage.
Vm. swappiness = 30

Restart the operating system to verify the result.
[Root @ oracle12c ~] # Uname-r
3.10.0-123. el7.x86 _ 64
[Root @ oracle12c ~] # Cat/sys/kernel/mm/transparent_hugepage/enabled
Always madvise [never]

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.