Skip to content
Welcome To Charanjit Cheema Blog

Welcome To Charanjit Cheema Blog

An Open Source and Cloud Blog

Menu
  • Home
  • About Me!
  • Way to my Technical Blog
  • Contact me
  • Privacy Policy
Menu

How to disable Transparent Huge Pages in Linux

Posted on May 11, 2020 by Charanjit Singh

Transparent Huge Pages (THP) is a feature available in mostly Linux distributions or distro which optimizes large memory of the systems as now days systems (computer systems) are coming with large memory. THP can enhance system performance by mapping memory with large physical pages this can be useful in case system is computing multiple processes, but this can prove adverse performance effect to memory intensive applications such as SAP HANA. In case of SAP HANA THP could cause HANA database hung and you may see symptoms such as HANA database doesn’t respond to requests, or where it is not possible to connect to the database (DB). In such cases disabling of THP is a good idea on those system which are hosting in-memory based database like SAP HANA.

I am working for a customer as a Linux Administrator where Linux servers are hosting SAP application BW and HANA DB. One day I got request from our SAP support team that they were facing issue in HANA DB, after checking I found HANA DB server which is running OS Suse Linux Enterprise Server 12 SP3 (SLES 12 SP3) has THP enabled as madvise.

So, I had to disabled the THP in SLES 12 SP3 server. In this tutorial I will show you how to disable the THP in Linux system I am taking example of SLES 12 but it is applicable for RHEL 7 and CentOS 7 Linux distro also. These steps will require to configure /etc/default/grub file and also will require system reboot so I suggest to have proper system configuration backup and take an adequate downtime for performing this activity.

Steps to disable THP

1. Verify if THP is enabled in system if below output show always or madvise that means THP is enabled in system:

# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never 

2. Append the line “transparent_hugepage=never” in kernel parameter option GRUB_CMDLINE_LINUX_DEFAULT (in some Linux distro you may only see this parameter option GRUB_CMDLINE_LINUX so you can append this line in this parameter also) in file /etc/default/grub:

# egrep -w "transparent_hugepage=never" /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="splash=silent quiet showopts crashkernel=295M transparent_hugepage=never"
#

Example of my SLES 12 SP3 server modified grub configuration, click on this image to see clearly in another browser tab:

3. Take the backup of /boot/grub2/grub.cfg file which will be helpful in restoring the configuration to previous stage in the event of system become unstable due to misconfiguration. After taking backup of file /boot/grub2/grub.cfg rebuild this file with command: grub2-mkconfig -o

4. Reboot the system with below command:

# shutdown -r now

Or

# reboot

5. Once system is up after reboot check the THP disable status from below command it should show THP status as never.

6. You can also verify the boot parameter of kernel after server reboot from below command:

# cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinux-4.4.180-94.113-default root=/dev/mapper/system-root splash=silent quiet showopts crashkernel=295M transparent_hugepage=never
#

 

Loading

  • Author
  • Recent Posts
Charanjit Singh
Follow him
Charanjit Singh
Charanjit is currently working as a Cloud Architect at Mphasis, with 18 years of experience in IT infrastructure projects, implementation, and support. While his main role is as a DevOps engineer, he holds a Cloud Architect position and has strong skills in cloud technologies and automation. His expertise includes Terraform, AWS, Azure DevOps, Azure Cloud, VMware, and Linux systems.

Charanjit is passionate about automating tasks and improving processes. He uses tools like Terraform and Azure DevOps to build and manage cloud infrastructure and streamline deployment. He also enjoys using Shell scripts and Ansible playbooks to make systems run more efficiently.

In his free time, Charanjit enjoys learning about new technologies and sharing his knowledge through his blog. When he’s not working, he likes listening to music, having a cup of coffee, and relaxing in nature.

You can connect with Charanjit on Twitter, Facebook, LinkedIn, or email him at charanjit.cheema@cjcheema.com.
Charanjit Singh
Follow him
Latest posts by Charanjit Singh (see all)
  • How to Deploy Docker Containers with NGINX on AWS EC2 Using Ansible and GitHub Actions - April 26, 2025
  • No More DynamoDB! Use Native S3 locking for Terraform State - February 7, 2025
  • How to Bring and Manage Manually Created AWS Resources Under Terraform Management - January 31, 2025

Like this:

Like Loading...

Related

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Tags

AWS Cloud Computing Dockers Networking Open Networking OpenSource RHEL-CentOS SDN Server Hardware SLES tcpdump Ubuntu WSL

Follow me @

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 2 other subscribers

Recent Posts

  • How to Deploy Docker Containers with NGINX on AWS EC2 Using Ansible and GitHub Actions
  • No More DynamoDB! Use Native S3 locking for Terraform State
  • How to Bring and Manage Manually Created AWS Resources Under Terraform Management
  • Iterating Cloud Resource Provisioning Using Terraform Count and For_Each Meta-Arguments
  • Terraform and Ansible Collaboration for AWS Cloud Deployment

Recent Comments

  1. Charanjit Singh on Terraform and Ansible Collaboration for AWS Cloud Deployment
  2. christinatodd2020aeaa798563 on Terraform and Ansible Collaboration for AWS Cloud Deployment
  3. Charanjit Singh on How to Set password policy in CentOS or RHEL system
  4. SAURABH on How to recover or rebuild initramfs in CentOS 7 Linux
  5. Sangita on How to Set password policy in CentOS or RHEL system

Archives

  • April 2025
  • February 2025
  • January 2025
  • August 2024
  • July 2024
  • June 2024
  • January 2024
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • September 2022
  • August 2022
  • July 2020
  • May 2020
  • February 2020
  • November 2019
  • June 2019
  • May 2019
  • March 2019
  • February 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • June 2018
  • May 2018
  • April 2018

Categories

  • Automation
  • Cloud Computing
  • Coding
  • CyberSecurity
  • Networking
  • OpenSource
  • RHEL-CentOS
  • Server Hardware
  • SLES
  • Technical Blog
  • Ubuntu
  • WSL

Blog Stats

  • 18,353 hits
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Home
  • About Me!
  • Way to my Technical Blog
  • Contact me
  • Privacy Policy
© 2025 Welcome To Charanjit Cheema Blog | Powered by Superbs Personal Blog theme
 

Loading Comments...
 

    %d