Howto start mongod as daemon on NUMA machine?

2,102 views
Skip to first unread message

Baurzhan Taishinov

unread,
Jul 26, 2011, 5:34:28 AM7/26/11
to mongod...@googlegroups.com
I installed mongodb on debian squeeze from 10gen repository. 
When started mondod writes to log

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

Howto change init script to start daemon with numactl?

--
С почтением, Бауыржан.

Scott Hernandez

unread,
Jul 26, 2011, 7:18:41 AM7/26/11
to mongod...@googlegroups.com
Change the init.d script or upstart job to use numactl as described
below instead of mongod as the startup process.

2011/7/26 Baurzhan Taishinov <baur...@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.
>

Baurzhan Taishinov

unread,
Jul 26, 2011, 9:06:29 AM7/26/11
to mongod...@googlegroups.com
In debian init script uses start-stop-daemon tool to start daemon.  Howto change this

DAEMON=/usr/bin/mongod
start_server() {
# Start the process using the wrapper
            start-stop-daemon --background --start --quiet --pidfile $PIDFILE \
                        --make-pidfile --chuid $DAEMONUSER \
                        --exec $DAEMON -- $DAEMON_OPTS
            errcode=$?
        return $errcode
}
 

to use numactl --interleave=all?


2011/7/26 Scott Hernandez <scotthe...@gmail.com>



--
С почтением, Бауыржан.

Steffen

unread,
Jul 26, 2011, 11:39:27 AM7/26/11
to mongodb-user
I did this in my Init script.
I added these lines in the start_server() function.
It's not perfect so I welcome for any suggestion.
..........
start_server() {
# check for numactl
NUMACTL=$(which numactl)
if [ -n "$NUMACTL" ]; then
DAEMON_OPTS="--interleave=all ${DAEMON} ${DAEMON_OPTS}"
DAEMON="$NUMACTL"
fi

# Start the process using the wrapper
...........

Regards,
Seffen

Alexander Azarov

unread,
Jul 26, 2011, 11:43:27 AM7/26/11
to mongod...@googlegroups.com
E.g.

            /usr/bin/numactl --interleave=all -- \

Baurzhan Taishinov

unread,
Jul 27, 2011, 1:34:41 AM7/27/11
to mongod...@googlegroups.com
This script not works:( I got an error 
start-stop-daemon: unrecognized option '--interleave=all'
Try 'start-stop-daemon --help' for more information.
 failed!



--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.




--
С почтением, Бауыржан.

Baurzhan Taishinov

unread,
Jul 27, 2011, 1:44:12 AM7/27/11
to mongod...@googlegroups.com
Sorry. Error caused by absence of numactl binary in my system. I need install numactl?
--
С почтением, Бауыржан.

Alexander Azarov

unread,
Jul 27, 2011, 1:44:59 AM7/27/11
to mongod...@googlegroups.com
Steffen, you will not be able to stop using "/etc/init.d/mongodb stop". There is nothing wrong in wrapping whole "start-stop-deamon" into "numactl", since "numactl" affects all the child hierarchy.

Steffen

unread,
Jul 27, 2011, 4:00:45 AM7/27/11
to mongodb-user
Ok, thanks for the tipp.
Stop is working with my solution too, because numactl is transparent
for the mongod process.

Baurzhan Taishinov

unread,
Jul 27, 2011, 5:42:43 AM7/27/11
to mongod...@googlegroups.com
Steffen thanks. It works. And /etc/init.d/mongodb stop works well.

On Wed, Jul 27, 2011 at 11:44 AM, Alexander Azarov <aza...@aha.ru> wrote:
Steffen, you will not be able to stop using "/etc/init.d/mongodb stop". There is nothing wrong in wrapping whole "start-stop-deamon" into "numactl", since "numactl" affects all the child hierarchy.

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/0BOeoE48W_YJ.

To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.



--
С почтением, Бауыржан.

Alexander Azarov

unread,
Jul 27, 2011, 10:45:19 AM7/27/11
to mongod...@googlegroups.com
Oh, my mistake then!

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.

mluggy

unread,
Feb 18, 2013, 2:23:47 AM2/18/13
to mongod...@googlegroups.com
Actually I couldn't get it to work with the init.d script that comes out of the box (mongo 2.3.3 on debian 6). Got the same problem with start-stop-daemon. This seems to solve it: https://github.com/chipitsine/mongo/commit/f82aba3e0d459d17bee06577c479361fba9dfcd6

Alexander Azarov

unread,
Feb 18, 2013, 2:35:04 AM2/18/13
to mongod...@googlegroups.com
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages