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

Lock 'timeAcquiringMicros' value is much higher than the actual time spent

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.8, 3.2.0-rc3
    • Affects Version/s: 3.0.7, 3.2.0-rc2
    • Component/s: Concurrency
    • Labels:
    • Fully Compatible
    • ALL
    • QuInt C (11/23/15)

      This is present both in 3.0 and in 3.2 (master), but not in 2.6 or earlier.

      For each wait which is more than a second, MongoDB will report the sum of arithmetic progression of all 500 msec increments of the wait, so basically we report approximately a square of the actual wait time.

      It happens on this line. For lock waits, we wake up every 500 milliseconds to check for deadlock and to also update the wait time counters so that if a thread is blocked for a long time, the currentOp statistics will reflect that. The bug is in that we do not reset the last sample timestamp and so the time keeps accumulating.

      The workaround until we fix it would be to take the square root of the wait time reported in the lock info.

            geert.bosch@mongodb.com Geert Bosch
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            0 Vote for this issue
            10 Start watching this issue