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
- is duplicated by
-
SERVER-7530 It looks like mongostat calculate locked wrong
- Closed