Transparent Huge Pages

Source: Internet
Author: User

In RHEL6, the transparent large page feature is turned on by default.

When this option is turned on, the kernel tries to allocate large pages as much as possible, and if the mmap area is 2MB, each Linux process will be assigned to a 2MB-sized page. If large pages are not enough (for example, physical memory is not enough), the kernel will reassign pages of size 4KB. Transparent large pages are interchangeable (swappable) by converting large pages to small 4KB pages.

For efficient use of large pages, the kernel must find contiguous available physical memory for allocation. A kernel thread was added for this purpose. Transparent large pages are similar to large pages: But transparent large pages are created automatically by kernel thread khugepaged at runtime, and large pages must be pre-allocated before starting.

Oracle recommends turning off transparent large pages: transparent large pages can cause unpredictable restarts of nodes, as well as performance problems with RAC, and transparent large pages can cause unpredictable performance issues or delays in a single-node database environment.

For example, after a RAC node restarts, the following log information may be found in Ocssd.log:

2013-05-01 14:30:45.255: [    cssd][224204544]clssscmonitorthreads Clssnmvkillblockthread not scheduled for 7500 msecs2013-05-01 14:30:46.945: [    

The MONGODB environment also recommends turning off the transparent large page feature.

Check that the transparent large page feature is turned on:

Rhel System:

# Cat/sys/kernel/mm/redhat_transparent_hugepage/enabled[always] Never

Other systems: (if the UEK2 kernel, 2.6.39-400.116.0 does not compile the transparent large pages, this file does not exist)

# Cat/sys/kernel/mm/transparent_hugepage/enabled[always] Never

[Always] means enable
[Never] means disable

Because the kernel simply uses transparent large pages for blocks of anonymous memory, such as stack and heap, anonhugepages in/proc/meminfo also indicates how much transparent large pages of memory the kernel uses:

# grep anonhugepages/proc/meminfo anonhugepages:  20142080 KB

Ways to disable transparent large pages:
1. Modify the file/etc/grub.conf and add a line:

Transparent_hugepage=never

2. Modify the file/etc/rc.local file to add:

If Test-f/sys/kernel/mm/transparent_hugepage/enabled; Then   echo never >/sys/kernel/mm/transparent_hugepage/enabledfiif test-f/sys/kernel/mm/transparent_hugepage /defrag; Then   echo never >/sys/kernel/mm/transparent_hugepage/defragfi

Transparent Huge Pages

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.