Hi MongoDB Community,
We are experiencing an issue with an insert operation of a time series that is taking longer than expected. Below is the log entry for the operation:
2024-06-27T09:35:48.405+0000 I COMMAND [conn18] command db.collection command: insert { insert: "db.collection", ordered: true, documents: 1000 } ninserted:1000 keysInserted:2000 numYields:0 reslen:44 locks:{ Global: { acquireCount: { r: 16, w: 16 } }, Database: { acquireCount: { w: 16 } }, Collection: { acquireCount: { w: 16 } } } protocol:op_query 2983ms
As you can see, the operation took 2983ms to complete. The number of locks acquired is also high:
Global: { acquireCount: { r: 16, w: 16 } }
Database: { acquireCount: { w: 16 } }
Collection: { acquireCount: { w: 16 } }
Here are some additional details about my setup:
MongoDB version: MongoDB server version: 3.4.24
Deployment type: Standalone
Number of concurrent operations: 2
Indexes on the collection: 1 on timeseries
I am trying to understand why this insert operation is taking so long and why the number of locks is so high. Could this be due to concurrency, indexing, or some other factors? What steps can I take to diagnose and resolve this issue?
Any insights or suggestions would be greatly appreciated.
Thank you!