| WARNING | OS Check | Linux transparent huge pages are enabled |
Starting with RedHat6, OL6, SLES11 and UEK2 kernels, Transparent HugePages are implemented and enabled (default) in an attempt to improve the memory management. Transparent HugePages are similar to the HugePages that have been available in previous Linux releases. The main difference is that the Transparent HugePages are set up dynamically at run time by the khugepaged thread in kernel while the regular HugePages had to be preallocated at the boot up time.
Starting with SLES11, RHEL6, OL6 and UEK2 Kernels, Transparent HugePages are introduced and enabled by default, and this can cause node reboots and performance problems.
Node reboots.
The ocssd.log may show some of the threads are blocked (but this does not show all the time):
The workaround provided here may not work for newer versions of Redhat like Redhat 7 or SLES. If the following workaround does not work, please contact Redhat or SLES (SUSE) for actual instruction on how to disable the transparent hugepages.
To check if the Transparent HugePages are enabled in your server execute the following:
Default/Enabled setting is [always]:
Disabled setting is [never]:
If "enabled" is NOT set to "[never]", the Transparent HugePages are being used.
You can also issue:
If the output contains a line like "AnonHugepages: xxxx kB", with a value > 0kB, the kernel is using Transparent HugePages.
Because the kernel currently uses Transparent HugePages only for the anonymous memory blocks like stack and heap, the value of AnonHugepages in /proc/meminfo is the current amount of Transparent HugePages that the kernel is using.
Add the following to the kernel boot line in /etc/grub.conf (a symlink to /boot/grub/grub.conf) and reboot the server (this is the preferred method):
Once modified the line will read similar to the following example:
OR
Add the following lines in /etc/rc.local and reboot the server (this still can be done on Redhat 7 although rc.local is being deprecated):
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
Please change the file path for RHEL kernel to /sys/kernel/mm/redhat_transparent_hugepage/ accordingly.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/27802288/viewspace-1711574/ ,如需转载,请注明出处,否则将追究法律责任。