Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8441969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:43:02+00:00 2026-06-10T08:43:02+00:00

I’m having some weird performance issues with MongoDB. First I tried to get about

  • 0

I’m having some weird performance issues with MongoDB. First I tried to get about ~1000 documents through the mongojs driver which did work, but finished the query in about 60+ seconds. Note that the documents are not big in any way!

Then I tried to do the same query but ran an explain() against the mongo shell to check if it really was just the query being so slow. Upon inspection it turned out that the query took only 4ms to complete! I have no idea what’s causing this. Any ideas?

Some more details:

  • Small documents
  • The MongoDB server is located on another server which I’m connected to through VPN
  • Indexes are placed where necessary

EDIT:

I ran wireshark and noticed the following:

  1. The query gets send to the server

  2. The server responds with 101 documents in under 1ms (always the same number)

  3. The client does a "Get More" request

  4. It takes about a minute or two before the server responds with the rest of the documents

  5. The "Get More" request and server responses with documents continues until it has sent everything. Which might take… forever for even the smallest set of around 1000 documents!

Here’s a piece of code that I run in the node CLI:

/* Get all the documents (about 1000) */
var db = require('mongojs').connect("myIpAddress", ["myCollection"]);
db.myCollection.find({}).forEach(function(err, doc) {
    console.log(doc);
});

EDIT 2:

I’m not sure whether it’s related but every now and then I get a "TCP Out of Order" packet from wireshark.

EDIT 3:

I tried to adjust the batch size, this did not work. I also tried MongoSkin to make sure it wasn’t mongojs doing something wrong, but that didn’t solve anything as well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:43:03+00:00Added an answer on June 10, 2026 at 8:43 am

    I fixed it by copying the MongoDB server to the same place where my Node server was running. I think it had to do with the VPN I was connected to, although I can’t say that with certainty.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
We're building an app, our first using Rails 3, and we're having to build
I am trying to loop through a bunch of documents I have to put
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I have a reasonable size flat file database of text documents mostly saved in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.