NUMA的关闭方法【转】

Centos 6

在/etc/grub.conf    在kernel 添加numa=off 就行了

一、检查OS是否开启NUMA
# numactl --hardware

available: 1 nodes (0)       #如果是2或多个nodes就说明numa没关掉

 

二、Linux OS层面禁用NUMA
1、修改 grub.conf
# vi /boot/grub/grub.conf
#/* Copyright 2010, Oracle. All rights reserved. */
 
default=0
timeout=5
hiddenmenu
foreground=000000
background=ffffff
splashimage=(hd0,0)/boot/grub/oracle.xpm.gz
 
title Trying_C0D0_as_HD0
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-128.1.16.0.1.el5 root=LABEL=DBSYS ro bootarea=dbsys rhgb quiet console=ttyS0,115200n8 console=tty1 crashkernel=128M@16M numa=off
initrd /boot/initrd-2.6.18-128.1.16.0.1.el5.img

 

2、重启Linux操作系统
# /sbin/reboot

 

 
3、确认OS层面禁用NUMA是否成功
# cat /proc/cmdline
root=LABEL=DBSYS ro bootarea=dbsys rhgb quiet console=ttyS0,115200n8 console=tty1 crashkernel=128M@16M numa=off
# numactl --hardware

 

 

Centos 7 mysql5.7关闭NUMA方法

登录Linux系统,修改/etc/init.d/mysqld文件,加上numactl --interleave all

vi /etc/init.d/mysqld

找到如下行

# Give extra arguments to mysqld with the my.cnf file. This script

   # may be overwritten at next upgrade.

   $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null &

   wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$?


将$bindir/mysqld_safe --datadir="$datadir"这一行修改为:

/usr/bin/numactl --interleave all $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null &

wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$?


然后重启MySQL服务

 

转自:

NUMA特性禁用 - zfox - 博客园 https://www.cnblogs.com/zfox2017/p/6491556.html

mysql5.7关闭NUMA方法 - formydream的博客 - 优快云博客 https://blog.youkuaiyun.com/jh993627471/article/details/79177884

针对跑MySQL的Linux优化经验-MySQL Life http://wubx.net/linux-performance-tuning-tips-mysql/

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值