The MongoDB replication oplog is, by default, 5% of your free disk space. The theory behind this is that, if you’re writing 5% of your disk space every x amount of time, you’re going to run out of disk in 19x time. However, this doesn’t hold true for everyone, sometimes you’ll need a larger oplog. Some common cases:
- Applications that delete almost as much data as they create.
- Applications that do lots of in-place updates, which consume oplog entries but not disk space.
- Applications that do lots of multi-updates or remove lots of documents at once. These multi-document operations have to be “exploded” into separate entries for each document in the oplog, so that the oplog remains idempotent.
Some of the tips in the post will require an upgrade to the latest MongoDB version. But you’ll want that anyways.
Original title and link: MongoDB Tips: Resizing Your Oplog (NoSQL databases © myNoSQL)