Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-975

make ClientCusror::yield do an adaptive sleep (WAS: Improve yielding for remove queries)

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.4.1, 1.5.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      ubuntu 9.10 64 bit, mongodb 1.4

      I'm currently runnning this query:

      {
      "opid" : 24472544,
      "active" : true,
      "lockType" : "write",
      "waitingForLock" : false,
      "secs_running" : 6600,
      "op" : "remove",
      "ns" : "mydb.mycoll",
      "query" : {
      "entry" :

      { "$ne" : "string" }

      },
      "client" : "127.0.0.1:48464",
      "desc" : "conn"
      },

      It's now taking > 100 minutes (and still a long way to go) for a 17 million documents collection.

      The main problem is that it seems to completely lock the application and that it does not yield.
      When running .stats() or .count() from the mongo shell, it actually does let 3-4 inserts through, but only to retake the lock and keep it after a few seconds.

      This is what I usually see in mongostats:
      insert/s query/s update/s delete/s getmore/s command/s mapped vsize res % locked % idx miss conn time
      0 0 0 0 0 2 49161 49967 5892 0.979 0.0131 14 17:01:28
      0 0 0 0 0 2 49161 49967 5891 0.935 0.0102 14 17:01:29
      0 0 0 0 0 2 49161 49967 5890 1.08 0.00866 14 17:01:30
      0 0 0 0 0 2 49161 49967 5888 0.999 0.0106 14 17:01:31
      0 0 0 0 0 2 49161 49967 5886 0.977 0.0112 14 17:01:32
      0 0 0 0 0 2 49161 49967 5885 1.01 0.00845 14 17:01:33
      0 0 0 0 0 2 49161 49967 5884 0.964 0.0147 14 17:01:34
      0 0 0 0 0 2 49161 49967 5885 1.04 0.0121 14 17:01:35
      0 0 0 0 0 2 49161 49967 5884 0.986 0.0147 14 17:01:36
      0 0 0 0 0 2 49161 49967 5883 1.03 0.0121 14 17:01:37
      0 0 0 0 0 2 49161 49967 5881 0.986 0.0117 14 17:01:38
      0 0 0 0 0 2 49161 49967 5880 0.958 0.0123 14 17:01:39
      0 0 0 0 0 2 49161 49967 5878 1.03 0.0133 14 17:01:40
      0 0 0 0 0 2 49161 49967 5878 0.975 0.0124 14 17:01:41
      0 0 0 0 0 2 49161 49967 5876 1.05 0.0122 14 17:01:42
      0 0 0 0 0 2 49161 49967 5878 0.931 0.0151 14 17:01:43

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            rb2k Marc Seeger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: