title: Mongodb read locks
body: <p>I have a mongodb collection with custom _id and 500M+ documents. Size of the _id's index is ≈25Gb and whole collection is ≈125 Gb. Server has 96 Gb RAM. Read activity is only range queries by _id. Explain() shows that queries use the index. Mongo works rather fast some time after load tests start and slows down after a while. I can see in a log a lot of entries like this:</p>
  
  <p><em>[conn116] getmore csdb.archive query: { _id: { $gt: 2812719756651008, $lt: 2812720361451008 } } cursorid:444942282445272280 ntoreturn:0 keyUpdates:0 <strong>numYields: 748 locks(micros) r:7885031</strong> nreturned:40302 reslen:1047872 <strong>10329ms</em></strong></p>
  
  <p>A piece of db.currentOp():</p>
  
  <pre><code>"waitingForLock" : false,
                          "numYields" : 193,
                          "lockStats" : {
                                  "timeLockedMicros" : {
                                          "r" : NumberLong(869051),
                                          "w" : NumberLong(0)
                                  },
                                  "timeAcquiringMicros" : {
                                          "r" : NumberLong(1369404),
                                          "w" : NumberLong(0)
                                  }
                          }
  </code></pre>
  
  <p>What is locks(micros) r? What can I do to cut it down? </p>