numactl对数据库性能的影响

本文讨论了numactl工具对MongoDB性能的影响,并提供了具体的启动命令建议。同时,文章还提到了Cassandra中如何使用numactl来避免性能问题。

据说numactl对mongod的性能影响很大,未验证。

MongoDB shell version: 2.4.8
connecting to: test
Server has startup warnings: 
Wed Dec 25 22:10:01.043 [initandlisten] 
Wed Dec 25 22:10:01.043 [initandlisten] ** WARNING: You are running on a NUMA machine.
Wed Dec 25 22:10:01.043 [initandlisten] **          We suggest launching mongod like this to avoid performance problems:
Wed Dec 25 22:10:01.043 [initandlisten] **              numactl --interleave=all mongod [other options]
Wed Dec 25 22:10:01.043 [initandlisten] 

按照提示在启动命令前加上 numactl --interleave选项

numactl --interleave=all /root/mongodb/bin/mongod --dbpath=/data/db/ --fork --logpath=/data/logs/db.log --directoryperdb

cassandra中也是使用了这个参数:

https://github.com/apache/cassandra/blob/fe3cfe3d7df296f022c50c9c0d22f91a0fc0a217/bin/cassandra#L110

# If numactl is available, use it. For Cassandra, the priority is to
# avoid disk I/O. Even for the purpose of CPU efficiency, we don't
# really have CPU<->data affinity anyway. Also, empirically test that numactl
# works before trying to use it (CASSANDRA-3245).
NUMACTL_ARGS=${NUMACTL_ARGS:-"--interleave=all"}
if which numactl >/dev/null 2>/dev/null && numactl $NUMACTL_ARGS ls / >/dev/null 2>/dev/null
then
NUMACTL="numactl $NUMACTL_ARGS"
else
NUMACTL=""
fi

转载于:https://my.oschina.net/chuqq/blog/1574539

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值