通过配置服务方式
-
-
cat >/etc/systemd/system/disable-thp.service <<!
-
-
[Unit]
-
Description=Disable Transparent Huge Pages (THP)
-
-
[Service]
-
Type=simple
-
ExecStart=/bin/sh -c "echo 'never' >/sys/kernel/mm/transparent_hugepage/enabled && echo 'never' >/sys/kernel/mm/transparent_hugepage/defrag"
-
-
[Install]
-
WantedBy=multi-user.target
-
-
!
-
-
systemctl daemon-reload
-
systemctl start disable-thp
-
systemctl enable disable-thp
-
systemctl status disable-thp
-
实施时,只需用 root 全选,粘贴。
参考:
在 Oracle Linux 7 上禁用透明 HugePages(文档 ID 2336923.1)
阅读(1129) | 评论(0) | 转发(0) |