Poor MongoDB performance with C# driver

1,225 views
Skip to first unread message

mike.g...@morrisby.com

unread,
Jan 27, 2014, 7:52:55 AM1/27/14
to mongod...@googlegroups.com
I am having a problem with poor query performance on a small mongo database I have set up. I have asked a question on stack-overflow so I won't repeat the nitty gritty here. the question is at (question contains details of document structure, collections size, query execution plan using .explain() etc):  


In a nutshell I have recently been working to set up a Mongo db server to act as an object cache for a website. However after setting everything up I am concerned that the performance is quite slow.

It is a single server, not part of a replica set or sharded. I am running all tests from my local machine to the server which is on a Windows Azure VM.

For example I have a collection of approximately 5,500 documents where each document stores a link to an external site. Performing a basic search that return approx 3000 results takes nearly 3 seconds. I have all the relevant indexes configured and I just can't understand why it would take so long to retrieve a relatively small result set from a very small collection

Asya Kamsky

unread,
Jan 28, 2014, 7:04:03 AM1/28/14
to mongodb-user

Windows on Azure have problems with performance.  This is not limited to MongoDB.

Asya

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

Asya Kamsky

unread,
Jan 28, 2014, 7:12:06 AM1/28/14
to mongodb-user

The problems we know about have to do with IOPs.

Looking at your details, it seems clear     the time is not spent in MongoDB - the queries are running in single digit milliseconds. What the network between application and DB?

Asya

On Jan 27, 2014 5:38 AM, <mike.g...@morrisby.com> wrote:
--

mike.g...@morrisby.com

unread,
Jan 28, 2014, 7:18:48 AM1/28/14
to mongod...@googlegroups.com
The network is fairly simple (at least until it gets to Microsoft's datacentre). We are a small company and our network is not very large. It goes from my machine through local server/firewall and then straight to the internet. On azure it is connecting to the VM via a load balancer.

mike.g...@morrisby.com

unread,
Jan 28, 2014, 11:28:16 AM1/28/14
to mongod...@googlegroups.com
After spending the day doing profiling it seems it is network latency that is the main problem. When I pushed a build of the websites to Azure and ran it (so the connection would have been entirely inside Microsoft data centre) we saw an immediate speed up by a factor of 10! Thank you everyone for you help on the issue

Asya Kamsky

unread,
Jan 28, 2014, 1:19:10 PM1/28/14
to mongodb-user
Mike,

Excellent, thanks for letting us know where the problem was.

This of course highlights the importance of measuring *both* the time
the operations take on the DB (slow ones > 99ms will be logged to
mongod log by default) *and* from the application as the end user
certainly doesn't care if the delay is in the application, the network
or the database, they just care that it's slow! :)

As developers and ops for the application though we care *very* much
where the bottleneck is!

Asya
Reply all
Reply to author
Forward
0 new messages