Skip to Content
MongoDB: The Definitive Guide, 3rd Edition
book

MongoDB: The Definitive Guide, 3rd Edition

by Shannon Bradshaw, Eoin Brazil, Kristina Chodorow
December 2019
Intermediate to advanced
511 pages
12h 50m
English
O'Reilly Media, Inc.
Book available
Content preview from MongoDB: The Definitive Guide, 3rd Edition

Chapter 22. Monitoring MongoDB

Before you deploy, it is important to set up some type of monitoring. Monitoring should allow you to track what your server is doing and alert you if something goes wrong. This chapter will cover:

  • How to track MongoDB’s memory usage

  • How to track application performance metrics

  • How to diagnose replication issues

We’ll use example graphs from MongoDB Ops Manager to demonstrate what to look for when monitoring (see installation instructions for Ops Manager). The monitoring capabilities of MongoDB Atlas (MongoDB’s cloud database service) are very similar. MongoDB also offers a free monitoring service that monitors standalones and replica sets. It keeps the monitoring data for 24 hours after it has been uploaded and provides coarse-grained statistics on operation execution times, memory usage, CPU usage, and operation counts.

If you do not want to use Ops Manager, Atlas, or MongoDB’s free monitoring service, please use some type of monitoring. It will help you detect potential issues before they cause problems and diagnose issues when they occur.

Monitoring Memory Usage

Accessing data in memory is fast, and accessing data on disk is slow. Unfortunately, memory is expensive (and disk is cheap), and typically MongoDB uses up memory before any other resource. This section covers how to monitor MongoDB’s interactions with the CPU, disk, and memory, and what to watch for.

Introduction to Computer Memory

Computers tend to have a small amount of fast-to-access memory and ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

MongoDB - The Complete Developer's Guide

MongoDB - The Complete Developer's Guide

Maximilian Schwarzmüller
The Complete Node.js Developer Course (3rd Edition)

The Complete Node.js Developer Course (3rd Edition)

Andrew Mead, Codestars By Rob Percival

Publisher Resources

ISBN: 9781491954454Errata Page