I have around 4000 records in my table (3MB) in total.
A few days ago, my application became slow when I run findAll(). (normally, it takes 3 seconds to get all data, but now it takes 30 seconds to get all data).
By checking the log, I can see that, for first 101 records, it took 800ms but for the rest 3000+ records took around 25seconds to process from “getMore” Command.
I wonder if there is anything changed from mongodb service, if not, how should I fix this issue?
2024-06-25 23:12:28.282 DEBUG 92737 --- [nio-8080-exec-5] org.mongodb.driver.protocol.command : Command "find" started on database xxxxxx(myDB) using a connection with driver-generated ID 7 and server-generated ID 359278 to ac-ktqn9ck-shard-00-02.dxlowxv.mongodb.net:27017. The request ID is 126. Command: {"find": "store_info", "filter": {}, "$db": "(myDB)", "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1719371540, "i": 17}}, "signature": {"hash": {"$binary": {"base64": "seWJAmzUG+s7FNRGd8quBA56qiU=", "subType": "00"}}, "keyId": 7329958630948601874}}, "lsid": {"id": {"$binary": {"base64": "DOjrGyGyTxGodObhFX8SBw==", "subType": "04"}}}}
2024-06-25 23:12:29.130 DEBUG 92737 --- [nio-8080-exec-5] org.mongodb.driver.protocol.command : Command "find" succeeded in 844.27 ms using a connection with driver-generated ID 7 and server-generated ID 359278 to ac-ktqn9ck-shard-00-02.dxlowxv.mongodb.net:27017. The request ID is 126. Command reply: {"cursor": {"firstBatch": [...(my data here)]
2024-06-25 23:12:29.131 DEBUG 92737 --- [nio-8080-exec-5] org.mongodb.driver.operation : Received batch of 101 documents with cursorId 3203780083378422937 from server ac-ktqn9ck-shard-00-02.dxlowxv.mongodb.net:27017
2024-06-25 23:12:29.144 DEBUG 92737 --- [nio-8080-exec-5] org.mongodb.driver.protocol.command : Command "getMore" started on database TPSI_PROD using a connection with driver-generated ID 7 and server-generated ID 359278 to ac-ktqn9ck-shard-00-02.dxlowxv.mongodb.net:27017. The request ID is 127. Command: {"getMore": 3203780083378422937, "collection": "store_info", "$db": "(MYDB)", "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1719371548, "i": 9}}, "signature": {"hash": {"$binary": {"base64": "a6bHBg5M4fkAfg3nUqNCely4w64=", "subType": "00"}}, "keyId": 7329958630948601874}}, "lsid": {"id": {"$binary": {"base64": "DOjrGyGyTxGodObhFX8SBw==", "subType": "04"}}}}
2024-06-25 23:12:55.562 DEBUG 92737 --- [nio-8080-exec-5] org.mongodb.driver.protocol.command : Command "getMore" succeeded in 26352.68 ms using a connection with driver-generated ID 7 and server-generated ID 359278 to ac-ktqn9ck-shard-00-02.dxlowxv.mongodb.net:27017. The request ID is 127. Command reply: {"cursor": {"nextBatch": [...(rest of my data)]
2024-06-25 23:12:55.598 DEBUG 92737 --- [nio-8080-exec-5] org.mongodb.driver.operation : Received batch of 3608 documents with cursorId 0 from server ac-ktqn9ck-shard-00-02.dxlowxv.mongodb.net:27017
Any help is appreciated.
Thanks in advanced.