Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-552

Queries extremely slow or timeout with node driver but fine with mongo shell

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      MongoDB 3.0.5, node 0.12.7 on CentOS 6.5 and Mac OS X 10.10.5

      I'm using MongoDB 3.0.5 (with WiredTiger) to store about 20M docs like this:

      {
      "_id": ObjectId("55e7018e413a306517a980bd"),
      "s": 200
      "r": ["related1","related2","related3","related4","related5","related6","related7","related8","related9"],
      "m": [

      { "v": ["value1"], "c": 0.9329141439596679 }

      ,

      { "v": ["value1", "value2"], "c": 0.85163020143722 }

      ,

      { "v": ["value1"], "c": 0.905295321980623 }

      ,

      { "v": ["value1"], "c": 0.893197290636285 }

      ],
      "p": "ee3954d86e6228ee5e76eb3c20ffc234"
      }

      I have indexes on both "s" and "r" fields, but this query:

      db.test.find(

      {"r":"something"}

      ).limit(30).sort(

      {"s":-1}

      )

      sometimes run forever and eventually timeout when using the node driver (about 50% success, 50& timeout).

      I've test the same query with the mongo shell, and it always return within several ms and never got a timeout.

      I can reproduce this issue on both Linux and Max, this is so strange...

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            peakji Peak Ji
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: