MongoDB Atlas oplog is slowing down queries

I’m on the M2 cluster tier and have a single 3MB document that I am querying every minute. The queries have gone from taking less than a second to pull the data to consistently taking over 30 seconds to pull the single document. I noticed that my oplog is over 3.5GB and assuming this is why the queries have become so slow. I’ve been researching and it looks like I have no control of the oplog through Atlas. Is there anything I can do to reduce the size of the oplog and make the query faster again?

Hi @Levi_Ackerman - Welcome to the community :slight_smile:

I was not aware one of the Survey Corps members used Atlas! :joy:

The queries have gone from taking less than a second to pull the data to consistently taking over 30 seconds to pull the single document.

Regarding your issue with the >30 second query time, it is possible you’ve hit the Data Transfer Limits as part of the free/shared tier limitations. As per the same docs:

Atlas handles clusters that exceed the rate limit as follows:

  • Atlas throttles the network speed of the cluster.
  • Atlas triggers a one second cooldown period before resuming the cluster’s operations on a given connection. If the queue is greater than the operations per second limit, operations might wait for more than a second in the queue.
  • If the amount of transferred data drops below the rate limit threshold, Atlas resumes processing of the queued data transfers on each connection before processing any new data transfers on that connection.

This may explain the delay if you have exceeded the limit(s). If you’re still experiencing the delay, I would contact the Atlas support team via the in-app chat and see if the support members can check if this limit has been exceeded for your particular M2 cluster in question.

Regards,
Jason

3 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.