Mongodb performance issue

when am trying to view collection data throw compass,it is taking few millisec but while trying to view data by connecting SAP system to mongodb using adopter,its taking 90 sec.

Can anyone help to check this performance issue.

Hi @Rojalin_Das1

If Compass can do it very quickly but not SAP, it seems to me that the problem does not lie in MongoDB. Some things I would check:

  • When you say Compass can do it a lot faster, are you running the exact same queries as the SAP system does?
  • What is the connector are you using?
  • Is there any slow queries that you see in the MongoDB logs?
  • Where is the MongoDB deployment located, is it on-prem, Atlas, others?
  • What is your MongoDB version?

Best regards


One thing not to forget is that Compass is paging the result, downloading and showing only the first few documents despite matching many more. It is possible that your SAP system needs to download all the matching documents in order to do its tasks.

Thank You Kevin and Steeve for your suggestions. I am still working on this performance issue and keeping all these points in mind.

Actually the scenario is ,
Using the SAP interface and the extra connector (odbc driver) trying to connect mongodb and extracting data from mongodb to the oracle database and it perform very slow process.

Checked the mongodb log. I found the opened connections but it is not ended and while loading data to the oracle data base,the job getting stuck in middle ,which is running in SAP system.

HI Steeve,
The problem is job getting stop after running for few mins. If it is running slow and giving output in late or delay, then i can think of performance issue. But the job is getting hung.

Can you please suggest me, if is there any constraint on row limit or any file size limit while loading data from our mongo side.

If your use-case is slow because you are using SAP and SAP requires a huge number of documents to perform your use case, then the only optimization I can see is that you stop using SAP and implement your use case with the aggregation framework which can process the huge number of documents directly on the server.

You did not answer

In addition to know where the MongoDB deployment is located, it would be nice to have the system specification of this deployment. Memory, disk, CPU, size of collections, …

Since you mentioned

Where is the deployment and specifications of this oracle database? May be it is the one slowing everything. It is much slower to write data and update indexes that reading.

If you only use SAP via ODBC to copy over some data into SQL, why don’t you simple mongoexport, use any tool that maps JSON to SQL, then import the result.