您的位置:首页 > 数据库

numactl对数据库性能的影响

2017-11-16 00:00 316 查看
据说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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  numactl cassandra