[Fixed] MongoDB OpLog Slow

Just wanted to record a note online regarding MongoDB OpLog.

I was super confused to why my OpLog was running SO SLOW. Isn’t it supposed to be super fast? I have like 5 users connected. What’s going on?

I am running 3 instances of MongoDB on the same VM in an oplog configuration, rather than 3vms to save some money.

I had given 8gb of RAM to that server. That was NOT enough.

So what you’ll see happen is the MongoDB and your Meteor application spin WILDLY out of control! I had re subscriptions all over the place, users were getting like 15 duplicate notifications. RAM was 100% on the server.

I thought “I should try Redis”, “I should quit”, etc…

But, then I just increased the RAM to 16gb. Problem solved.

Oddly, the server now uses LESS ram than it did before, sitting happily at like 54%.

tldr: 3 Instances of MongoDB OpLog uses a LOT of RAM. It holds all those collections in the RAM for fast access.