Forge Home


Disables Transparent Hugepages (THP)


37,801 latest version

3.1 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.5.0 (latest)
  • 1.4.1
  • 1.4.0
  • 1.3.0
  • 1.2.1
  • 1.2.0
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
released Apr 20th 2020
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.0.0 < 7.0.0
  • , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'alexharvey-disable_transparent_hugepage', '1.5.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add alexharvey-disable_transparent_hugepage
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install alexharvey-disable_transparent_hugepage --version 1.5.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.



alexharvey/disable_transparent_hugepage — version 1.5.0 Apr 20th 2020


Build Status

Table of contents

  1. Overview
  2. Usage
  3. Development


This module disables Transparent Hugepages (THP) on Linux platforms as required by applications such as MongoDB and Redis. The procedure is based on recommendations published at

The module changes the /sys/kernel/mm/transparent_hugepage/enabled and /sys/kernel/mm/transparent_hugepage/defrag settings, adds an init service to ensure the changes persist across reboots, and if applicable, configures tuned.


Basic use:

include disable_transparent_hugepage


Please read before contributing.


Make sure you have:

  • rake
  • bundler

Install the necessary gems:

bundle install

To run the tests from the root of the source code:

bundle exec rake spec

To run the acceptance tests:

To run the acceptance tests:

BEAKER_set=centos-66-x64 bundle exec rake spec/acceptance
BEAKER_set=centos-72-x64 bundle exec rake spec/acceptance



This module uses Puppet Blacksmith to publish to the Puppet Forge.

Ensure you have these lines in ~/.bash_profile:


Build the module and push to Forge:

bundle exec rake module:push

Clean the pkg dir (otherwise Blacksmith will try to push old copies to Forge next time you run it and it will fail):

bundle exec rake module:clean