PS: This is for forum https://www.schoenen-dunk.de/ (must be well known to nodeBB)
B
big_steve
@big_steve
Posts
-
Slow Queries in MongoDB -
Slow Queries in MongoDBHi, we see increased numbers of these log entries in mongoDB
{"t":{"$date":"2024-10-09T09:30:16.143+02:00"},"s":"I", "c":"COMMAND", "id":51803, "ctx":"conn39","msg":"Slow query","attr":{"type":"command","ns":"nodebb.objects","command":{"find":"objects"," filter":{"_key":"topics:tid"},"sort":{"score":1},"projection":{"_id":0,"_key":0,"score":0},"skip":129000,"limit":500,"lsid":{"id":{"$uuid":"dedb7031-7a1d-4cc0-82ba-1a47d0d18b35"}},"$db":"nodebb"}," planSummary":"IXSCAN { _key: 1, score: -1 }","planningTimeMicros":123,"cursorid":669374630645032835,"keysExamined":129101,"docsExamined":101,"fromMultiPlanner":true,"replanned":true,"replanReason": "cached plan was less efficient than expected: expected trial execution to take 10001 reads but it took at least 100011 reads","nBatches":1,"numYields":244,"nreturned":101,"queryHash":"A3928A9F","p lanCacheKey":"ED34AECF","queryFramework":"sbe","reslen":2821,"locks":{"FeatureCompatibilityVersion":{"acquireCount":{"r":245}},"Global":{"acquireCount":{"r":245}}},"storage":{"data":{"bytesRead":21 6878,"timeReadingMicros":195}},"cpuNanos":224969561,"remote":"127.0.0.1:54830","protocol":"op_msg","durationMillis":224}}
What is the proper way to check if indexes are setup correctly?
We have left cache sizes in nodeBB as default so far - do they impact those kind of issues?
I see Post Cache Hit Ratio only at 25%.
I assume increasing the post cache size has effect on mem needed for the node process?Thanks
SK