Daniel Watrous on Software Engineering

A Collection of Software Problems and Solutions

Software Engineering

MongoDB monitoring with mongostat

Another tool for monitoring the performance and health of a MongoDB node is mongostat. You’ll recall that mongotop shows the time in milliseconds that a mongo node spent accessing (read and write) a particular collection.

mongostat on the other hand provides more detailed information about the state of a mongo node, including disk usage, data throughput, index misses, locks, etc. However, the data is general to the mongo node and doesn’t indicate which database or collection the status refers to. As you would expect, both utilities, mongotop and mongostat, are required to get a full picture of the state of a node and which databases/collections are most affected.

Here’s some sample output from mongostat for two different servers, a PRIMARY and a SECONDARY.

insert  query update delete getmore command flushes mapped  vsize    res faults      locked db idx miss %     qr|qw   ar|aw  netIn netOut  conn        set repl       time
    *0    208     *0     *0       0     4|0       0  5.76g  12.1g    87m      0 documents:0.0%          0       0|0     0|0    16k    70k    23 wildcatset  SEC   15:28:29
    *0    197     *0     *0       0     1|0       0  5.76g  12.1g    87m      0 documents:0.0%          0       0|0     0|0    15k    65k    23 wildcatset  SEC   15:28:30
    *0    215     *0     *0       0     3|0       0  5.76g  12.1g    87m      0 documents:0.0%          0       0|0     0|0    16k    71k    23 wildcatset  SEC   15:28:31
    *0    198     *0     *0       0     1|0       0  5.76g  12.1g    87m      0 documents:0.0%          0       0|0     0|0    15k    65k    23 wildcatset  SEC   15:28:32
    *0    227     *0     *0       0     3|0       0  5.76g  12.1g    87m      0 documents:0.0%          0       0|0     0|0    17k    75k    23 wildcatset  SEC   15:28:33
insert  query update delete getmore command flushes mapped  vsize    res faults      locked db idx miss %     qr|qw   ar|aw  netIn netOut  conn        set repl       time
     0    269      0      0       1       2       0  5.56g  11.8g    85m      0 documents:0.0%          0       0|0     0|0    20k    89k    43 wildcatset  PRI   15:28:32
     0    216      0      0       0       2       0  5.56g  11.8g    85m      0 documents:0.0%          0       0|0     0|0    16k    72k    43 wildcatset  PRI   15:28:33
     0    227      0      0       0       3       0  5.56g  11.8g    85m      0 documents:0.0%          0       0|0     0|0    17k    77k    43 wildcatset  PRI   15:28:34
     0    235      0      0       0       2       0  5.56g  11.8g    85m      0 documents:0.1%          0       0|0     0|0    18k    77k    43 wildcatset  PRI   15:28:35
     0    214      0      0       0       2       0  5.56g  11.8g    85m      0 documents:0.0%          0       0|0     0|0    16k    71k    43 wildcatset  PRI   15:28:36

1 Comment MongoDB monitoring with mongostat

  1. Pingback: MongoDB monitoring with mongotop | Daniel Watrous on Software Engineering

Leave A Comment