C++ driver performance

216 views
Skip to first unread message

Emre Kanca

unread,
Jan 27, 2012, 6:26:28 PM1/27/12
to mongodb-user
Hi all,

I have a few questions sorted bellow. Thank you for any comment.

-- Question 1) I am asking to make sure. Does MongoDB communicate by
using boost:asio ?
as I see #include <boost/asio.hpp> in the
"message_server_asio.cpp"

I read a lot that, asio is not fast and it won't saturate CPU cores.
As one of them quoted below

"boost::asio is not as thread-friendly as you would hope - there is a
big lock around the epoll code in boost/asio/detail/epoll_reactor.hpp
which means that only one thread can call into the kernel's epoll
syscall at a time."

quoted from http://stackoverflow.com/questions/1234750/c-socket-server-unable-to-saturate-cpu


To stop me worrying, are there any benchmarks or experiences you would
tell me performance of driver won't be a problem.


-- Question 2) First I managed to compile tuts with C and C++ drivers
and run (C++ was hard though)

I could go with C but I think C++ driver is going to be the most
mature (and fast?) driver overall because of the statement below
" As the database is written in C++, the driver actually uses some
core MongoDB code -- this is the same driver that the database uses
itself for replication."

Am I wrong?

-- Question 3) C driver will use libev in "version 0.5". So (If CPP
uses ASIO) C driver 'll be more likely using more available sources
but C++ driver will have more capability. Is this assumption true?

Eliot Horowitz

unread,
Jan 27, 2012, 9:06:05 PM1/27/12
to mongod...@googlegroups.com
mongo doesn't use boost::asio at all right now, and does hare a lot of
code with the server (just about all )

> --
> 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.
>

Emre Kanca

unread,
Jan 28, 2012, 2:58:39 AM1/28/12
to mongodb-user
Concise and enough :) thanks.

On Jan 28, 4:06 am, Eliot Horowitz <el...@10gen.com> wrote:
> mongo doesn't use boost::asio at all right now, and does hare a lot of
> code with the server (just about all )
>
>
>
>
>
>
>
> On Fri, Jan 27, 2012 at 6:26 PM, Emre Kanca <kancae...@gmail.com> wrote:
> > Hi all,
>
> > I have a few questions sorted bellow. Thank you for any comment.
>
> > -- Question 1) I am asking to make sure.   Does MongoDB communicate by
> > using boost:asio ?
> > as I see       #include <boost/asio.hpp>      in the
> > "message_server_asio.cpp"
>
> > I read a lot that, asio is not fast and it won't saturate CPU cores.
> > As one of them quoted below
>
> > "boost::asio is not as thread-friendly as you would hope - there is a
> > big lock around the epoll code in boost/asio/detail/epoll_reactor.hpp
> > which means that only one thread can call into the kernel's epoll
> > syscall at a time."
>
> > quoted fromhttp://stackoverflow.com/questions/1234750/c-socket-server-unable-to-...
Reply all
Reply to author
Forward
0 new messages