web analytics

“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

Check if mongo is running


root@abc# ps aux | grep mongo
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


root@abc# mongo
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

3 comments to “WARNING: You are running on a NUMA machine We suggest launching mongod like this to avoid performance problems: ** numactl –interleave=all mongod [other options]

  • sac a main hermes occasion  says:

    sac a main hermes occasion

    Hello there, I found your internet site via Google while hunting for a associated subject matter , your site came up, it looks fantastic. Ia??ve bookmarked it in my google bookmarks

  • maillots 2013  says:

    maillots 2013

    I will bookmark your website and examine once again here frequently. I am very certain I will find out heaps of new stuff appropriate right here! Very good luck for the up coming!

  • Emiliano Ricci  says:

    Hi, there’s a place where it’s not accurate, I think because this page parsed your original text… it’s where you write about changing the mongodb.conf file, there should be double dashes in front of every option, and instead there’s only one: so, copying and pasting does not work. However, great tutorial, it helped me a lot

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>