MongoDB's monitoring preferred: Mongostat
Mongostat is really very useful, if the DB has an exception, my first reaction is to look at Mongostat. If it is the operation of the word, drinking coffee, watching mongostat, life is really comfortable ah. It's easy to run,./mongostat--host 10.45.3.97 --port 20127 The main details of the column meaning (also can refer to./mongostat--help) Www.2cto.com insert: Number of inserts in one second query: Number of queries in one second update: Updates in one second delete: & nbsp The number of deletions in a second 10 simple queries may be faster than a complex query, so the size of the numbers is not very significant. But at least you can know if the query is now being processed, whether it is inserted. If it is slave, there is always a *, which means replicate action getmore: cursor Getmore action useful Www.2cto.com command: Number of commands executed in a second for example, BULK INSERT, only one command is considered. It doesn't make much sense. If it is slave, will show two values, local|replicated, through the comparison of these two values, may be able to see the point of the problem. flushes: The number of flush times in a second generally 0, or 1, by calculating the interval between two 1, you can get a general idea of how long it takes to flush once. Flush overhead is great, and if you flush frequently, you may want to find out why. mapped: vsize:res: This is the same as you see with top, mapped, vsize generally do not have big changes, res will slowly rise, If the res often drops suddenly, check to see if any other program is eating memory. faults: don't be frightened by the name, this value is often not 0 under pressure. If it's often not 0, it's time to add memory. locked: MongoDB is a read-write lock, which refers to the percentage of time that a write lock lives. This value is too large (often more than 10%), that is the situation. idx miss: Very important parameters, normally, all queries should be indexed, that is, the idx miss is 0. If the value here is large, the index is missing. qr|qw:queue lengths for clients Waiting (Read|write) ar|aw:active clients (Read|write) If these two values are large, That is, the DB is blocked, the DB processing speed is less than the request speed. See if there is a lot of slow queries that are expensive. If the query is all right, it is really a heavy load, you need to add the machine. netin:network Traffic in-bitsnetout:network Traffic out-bits network bandwidth pressure, General MongoDB, the network will not become a bottleneck conn: Number of open connections MongoDB creates a thread for each connection, and the creation and release of threads is also overhead. Try not to make this a large number.  REPL: Server current status M -master sec-secondary rec-recovering unk-unknown slv-slave time: Current time
MongoDB monitoring