WARNING: You are running on a NUMA machine We suggest launching mongod like this to avoid performance problems: ** numactl –interleave=all mongod [other options]
Mongo was working fine in my Ubuntu machine, but whenever I access mongo shell, it will display the following warning.
root@abc:~# mongo
MongoDB shell version: 2.4.5
connecting to: test
Server has startup warnings:
Tue Aug 13 03:47:13.764 [initandlisten]
Tue Aug 13 03:47:13.764 [initandlisten] ** WARNING: You are running on a NUMA machine.
Tue Aug 13 03:47:13.764 [initandlisten] ** We suggest launching mongod like this to avoid performance problems:
Tue Aug 13 03:47:13.764 [initandlisten] ** numactl –interleave=all mongod [other options]
Tue Aug 13 03:47:13.764 [initandlisten]
First I checked, whether my hardware is NUMA(Non-Uniform Access Memory) enabled. I got the following output which said the answer is yes, it is NUMA enabled.
root@abcl# dmesg | grep -i numa
[ 0.000000] NUMA: Node 1 [mem 0x00000000-0xcfffffff] + [mem 0x100000000-0x82fffffff] -> [mem 0x00000000-0x82fffffff]
I can simply start mongo as said in the warning message, but what I was looking forward was a permanent fix which will let me start/stop mongo using the startup script.
Unfortunately, numactl command was not present in the server, so I installed the package as follows.
apt-get install numactl
After that, I did the following.
Added the following line to /etc/sysctl.conf
vm.zone_reclaim_mode = 0
Now, made the following change to the file /etc/init/mongodb.conf
Commented out line 18 which is as follows.
# if [ “x$ENABLE_MONGODB” = “xyes” ]; then exec start-stop-daemon –start –quiet –chuid mongodb –exec /usr/bin/mongod — –config /etc/mongodb.conf; fi
Now added the following line.
if [ “x$ENABLE_MONGODB” = “xyes” ]; then exec start-stop-daemon –start –quiet –chuid mongodb –exec /usr/bin/numactl — –interleave=all /usr/bin/mongod –config /etc/mongodb.conf; fi
Save and quit the file.
After doing this you need to restart mongodb and check whether mongo shell is accessible without the warning.
root@abc# /etc/init.d/mongodb start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mongodb start
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start mongodb
mongodb start/running, process 21750
mongodb 21750 1.0 0.0 348116 37516 ? Ssl 04:13 0:00 /usr/bin/mongod –config /etc/mongodb.conf
root 21762 0.0 0.0 9384 920 pts/0 S+ 04:13 0:00 grep –color=auto mongo
Try accessing the mongo shell
MongoDB shell version: 2.4.5
connecting to: test
>
bye
Success!!!! In case of error, you can check the log file at /var/log/mongodb/mongodb.log
Leave a Reply