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