How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 7

$ Solution 已验证 - 已更新2017年六月2日23:54 - English

环境

Red Hat Enterprise Linux 7

transparent hugepages (THP)

tuned

问题

How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 7

Disabling transparent hugepages (THP) on Red Hat Enterprise Linux 7 is not taking effect.

决议

Follow the steps below

1.Add the "transparent_hugepage=never" kernel parameter option to the grub2 configuration file.

Append or change the "transparent_hugepage=never" kernel parameter

on the GRUB_CMDLINE_LINUX option in /etc/default/grub file. Only include the parameter once.

vim /etc/default/grub

GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap ... transparent_hugepage=never"

2.Rebuild the /boot/grub2/grub.cfg file by running the grub2-mkconfig -o command as follows:

Please ensure to take a backup of the existing /boot/grub2/grub.cfg before rebuilding.

On BIOS-based machines: ~]# grub2-mkconfig -o /boot/grub2/grub.cfg

On UEFI-based machines: ~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

3.Reboot the system and verify option has been added

Reboot the system

# shutdown -r now

Verify the parameter is set correctly

# cat /proc/cmdline

正确的,应该含 transparent_hugepage=never

If Transparent Huge Pages (THP) is still not disabled, continue and use one of the options below.

Option 1: (Recommended) create a customized tuned profile with disabled THP

With this resolution we will create a customized version of the currently running profile. The customized version will disable THP.

Find out which profile is active, create a copy.

In the following example we currently use the throughput-performance profile:

# tuned-adm active

Current active profile: throughput-performance

To create customized profile, create a new directory in /etc/tuned directory with desired profile name.

# mkdir /etc/tuned/myprofile-nothp

Then create a new tuned.conf file for myprofile-nothp, and insert the new tuning info:

# cat /etc/tuned/myprofile-nothp/tuned.conf

[main]

include= throughput-performance

[vm]

transparent_hugepages=never

Make the script executable:

# chmod +x /etc/tuned/myprofile-nothp/tuned.conf

Enable myprofile like so:

# tuned-adm profile myprofile-nothp

This change will immediately take effect and persist reboots.

To verify if THP are disabled or not, run below command:

# cat /sys/kernel/mm/transparent_hugepage/enabled

Option 2: (Alternative) Disable tuned services

This resolution will disable the tuned services.

# systemctl stop tuned

# systemctl disable tuned

或者

# tuned-adm off

Now add "transparent_hugepage=never" kernel parameter in grub2 configuration file as explained in steps 1-3 above.

Reboot the server for changes to take effect.

How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 7的更多相关文章

  1. How to use, monitor, and disable transparent hugepages in Red Hat Enterprise Linux 6

    Resolution Note: Transparent Huge Pages are not available on the 32-bit version of RHEL 6. Transpare ...

  2. Disable or enable the IPv6 protocol in Red Hat Enterprise Linux

    Resolution Red Hat Enterprise Linux 4, 5 and 6 enable Internet Protocol Version 6 (IPv6) by default. ...

  3. setting up a IPSEC/L2TP vpn on CentOS 6 or Red Hat Enterprise Linux 6 or Scientific Linux

    This is a guide on setting up a IPSEC/L2TP vpn on CentOS 6 or Red Hat Enterprise Linux 6 or Scientif ...

  4. Configure Red Hat Enterprise Linux shared disk cluster for SQL Server——RHEL上的“类”SQL Server Cluster功能

    下面一步一步介绍一下如何在Red Hat Enterprise Linux系统上为SQL Server配置共享磁盘集群(Shared Disk Cluster)及其相关使用(仅供测试学习之用,基础篇) ...

  5. [转] KVM storage performance and cache settings on Red Hat Enterprise Linux 6.2

    Almost one year ago, I checked how different cache settings affected KVM storage subsystem performan ...

  6. Interpreting /proc/meminfo and free output for Red Hat Enterprise Linux 5, 6 and 7

    Interpreting /proc/meminfo and free output for Red Hat Enterprise Linux 5, 6 and 7 Solution Verified ...

  7. Common administrative commands in Red Hat Enterprise Linux 5, 6, and 7

    https://access.redhat.com/articles/1189123 Common administrative commands in Red Hat Enterprise Linu ...

  8. Configure Red Hat Enterprise Linux shared disk cluster for SQL Server

    下面一步一步介绍一下如何在Red Hat Enterprise Linux系统上为SQL Server配置共享磁盘集群(Shared Disk Cluster)及其相关使用(仅供测试学习之用,基础篇) ...

  9. Red Hat Enterprise Linux 6安装好,开启网卡到搭建tftp服务器和安装dnw驱动,安装samba服务器

    今天一顿误操作,只能把Red Hat Enterprise Linux 6重新安装,一些必备工作只能重做,重做之后立马把Linux的文件备份,以备不时只需! 开启Linux以太网卡:vim /etc/ ...

随机推荐

  1. jenkins备份与恢复【转】

    jenkins这里我通过thinbackup插件进行对jenkins的配置备份与恢复 1丶安装thinbackup插件 2丶系统管理选择thinbackup插件 3丶创建备份目录 mkdir /bac ...

  2. c++ 智能指针用法详解

    本文介绍c++里面的四个智能指针: auto_ptr, shared_ptr, weak_ptr, unique_ptr 其中后三个是c++11支持,并且第一个已经被c++11弃用. 为什么要使用智能 ...

  3. vue-创建新项目

    1.安装node,下载地址:https://nodejs.org/en/download/ 2.安装完成后打开cmd,输入node-v,出现版本信息说明安装成功 3.输入npm install -g ...

  4. form组件

    def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fields['hobby'].choices ...

  5. iOS开发常用第三库

    字典转模型 1.(MJExtension) https://github.com/CoderMJLee/MJExtension 2.(YYModel) https://github.com/ibire ...

  6. 一条很用的MSSQL语句

    select *,ActionName= stuff((select ',' + ActionName from Sys_Action_Table where ModuleId = Sys_Modul ...

  7. 使用Type.MakeGenericType,反射构造泛型类型

    有时我们会有通过反射来动态构造泛型类型的需求,该如何实现呢?举个栗子,比如我们常常定义的泛型委托Func<in T, out TResult>,当T或TResult的类型需要根据程序上下文 ...

  8. 必须知道的Linux内核常识详解

    一.内核功能.内核发行版 1.到底什么是操作系统 (1)linux.windows.android.ucos就是操作系统: (2)操作系统本质上是一个程序,由很多个源文件构成,需要编译连接成操作系统程 ...

  9. 10_27_requests模块

    1.get请求: 看源码 import requests url= "https://www.baidu.com" res = requests.get(url) print(re ...

  10. [NewLife.XCode]高级增删改

    NewLife.XCode是一个有10多年历史的开源数据中间件,支持nfx/netstandard,由新生命团队(2002~2019)开发完成并维护至今,以下简称XCode. 整个系列教程会大量结合示 ...