MongoDB 3.x – Maximum Oplog Size

MongoDB 3.x – Maximum Oplog Size

In the official MongoDB documentation, it is said that the maximum size for oplog is 50GB. With 5 years of Oracle database experience, I developed the bad habit of trusting official documentation entirely. Following the procedure to resize the oplog on my laptop, I was able to resize it to 60GB instead.

To check the current oplog size;

my_rs_1:PRIMARY> rs.printReplicationInfo() 

configured oplog size:   61440MB
log length start to end: 1568secs (0.44hrs)
oplog first event time:  Sun Jan 29 2017 17:55:26 GMT+0000 (GMT)
oplog last event time:   Sun Jan 29 2017 18:21:34 GMT+0000 (GMT)
now:                     Sun Jan 29 2017 18:25:29 GMT+0000 (GMT)

I have resized it to 60GB instead! 🙂

Working with MongoDB for the last 3 months has made me realised a lot of things that Oracle DBA has taken for granted. Things that is supposed to work the way it is documented seems to be a bonus instead of being a requirement.

P.S: On the hindsight, I believe the 50GB upper bound only applies for the default 5% and not the maximum configurable size.

Hope this helps!

Wei Shan


2 thoughts on “MongoDB 3.x – Maximum Oplog Size”

  1. The 50GB is upper bound of default size, not for what you can set. That is, if the 5% of physical memory will be more than 50GB default oplog size will still be set to 50GB.
    There still may be hard limit for oplog, but the documentation doesn’t specify that, nor did you do anything that proves documentation is wrong.

    1. You are right, I assumed that the maximum oplog size was 50GB when I first read the document. But after resizing it to 60GB, I do realized that it’s just a upper bound default oplog size, which explains the subsequent edit to the initial post 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s