MongoDB performance degradation in reading "oplog" using java driver after migrating from 2.6 to 3.6

Hi Team,

Recently we migrated from 2.6 to 3.6, Storage engine is still MMAVP1.

But our code is extremely slow to read data/transactions from “oplog” [ oplog size - 50 GB ]. Queries were taking more than 90 minutes to give an output.

After migration, Please let us know if any additional steps to be implemented regarding oplog configuration.

Below is the snapshot of code for reading the “oplog”. The test instance where we directly installed 3.6, the same code works without any lag.

Please let us know if there is any suggestion which need to be implemented on Mongo for improving the performance of reading the “oplog”.

private void readOplog() {

       Publisher<Document> pubDoc = null;
       MongoDBOperationsSubscriber<Document> sub = null;

       Document filter = new Document();
       filter.put("ns", namespace);
      
       pubDoc = fromCollection.find(clientSession, filter);
       sub = new MongoDBOperationsSubscriber<Document>();
       pubDoc.subscribe(sub);
       try {
           sub.await();
           sub.onComplete();
       } catch (Throwable e) {
           System.out.println(
                   "Read from Start, Error occurred while subscriber is in wait for messages from MongoDB publisher."
                           + e);
       }
       fetchedOplogDocs = sub.getData();
       System.out.println("Total documents fetched so far are [ "+ fetchedOplogDocs.size() +" ].");
 }

Hi :wave: @Anwesh_Kota,

Welcome to the MongoDB Community forums :sparkles:

Unfortunately, it’s difficult to say what is happening as both MongoDB 2.6 and 3.6 series are out of support, and the MMAPv1 storage engine was removed since MongoDB 4.2. It’s a distinct possibility that the issue you’re seeing is due to the characteristic of MMAPv1.

I would recommend you upgrade to a supported version of MongoDB using the WiredTiger storage engine as soon as possible.

Let me know if you have any further questions or concerns.

Best,
Kushagra