Report this

What is the reason for this report?

MongoDb slow performance

Posted on June 9, 2024

Hi, I am trying to move my infrastructure from different cloud provider and got stuck on MongoDB performance in Digital Ocean. All my queries take two times more execution time than it should be compare to previous provider and even localhost. I tested it on the same data, no indexes.

I used .explain("executionStats") command to get execution times. The results:

Digital Ocean:

"executionStats": {
  "executionSuccess": true,
  "nReturned": 12,
  "executionTimeMillis": 609,
  "totalKeysExamined": 0,
  "totalDocsExamined": 333969,

Previous provider:

"executionStats": {
  "executionSuccess": true,
  "nReturned": 12,
  "executionTimeMillis": 256,
  "totalKeysExamined": 0,
  "totalDocsExamined": 333969,

Localhost:

`"executionStats": {
  "executionSuccess": true,
  "nReturned": 12,
  "executionTimeMillis": 221,
  "totalKeysExamined": 0,
  "totalDocsExamined": 333969`,

I run these tests multiple times, tried different queries, but DO is always significantly slower. I tried to scale up DO more, but it didn’t help. I use managed MongoDB 4 GB RAM / 2vCPU / 56 GB Disk in Frankfurt. I had similar setup with previous provider.

Any help appreciate it, thank you.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.