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

mongostat calculates locked db incorrectly, it doesn't divide by the sampling time

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.2.4, 2.4.0-rc0
    • Component/s: Tools
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      It seems that when mongostat is calculating the "locked db" field then it does not take into account the sampling time. I have a small sample database and when using the same test script, mongostat displays greater and greater values if I increase the sampling time:

      [baxi@chivas]$ ./mongostat.exe -h 192.168.25.246 15
      connected to: 192.168.25.246
      ... locked db idx miss % qr|qw ar|aw netIn netOut conn time
      ... .:2.1% 0 0|0 0|0 1k 1k 1 14:34:02
      ... .:3.9% 0 0|0 0|0 1k 1k 1 14:34:17
      [baxi@chivas]$ ./mongostat.exe -h 192.168.25.246 60
      connected to: 192.168.25.246
      locked db idx miss % qr|qw ar|aw netIn netOut conn time
      ... .:6.6% 0 0|0 0|0 1k 809b 1 14:42:26
      ... .:10.1% 0 0|0 0|0 1k 860b 1 14:43:26
      [baxi@chivas]$ ./mongostat.exe -h 192.168.25.246 300
      connected to: 192.168.25.246
      locked db idx miss % qr|qw ar|aw netIn netOut conn time
      ... .:39.4% 0 0|0 0|0 1k 811b 1 14:48:33
      ... .:39.2% 0 0|0 0|0 1k 838b 1 14:53:33

      I calculated these values manually using the mongo shell and db.serverStatus() and got approximatelly the same result if using the expression diff(locks...timeLockedMicros.W)/1000/1000*100, but it should be
      (diff(locks...timeLockedMicros.W)/1000/1000)/diff(uptimeMillis/1000)*100, or something like that

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pasette Daniel Pasette
              Reporter:
              baxi Balazs Szabo
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: