Mongodb only use single core? All queries stuck when there is a long running $near query

StackOverflow https://stackoverflow.com/questions/19702845

  •  02-07-2022
  •  | 
  •  

Question

There are 1 million geo-data in my database and 20% of them are [0,0]

I run the simple query db.test.find({lc:{$near:[0,0]}}), which is extremely slow. It costs about 20~30 seconds because the data will be sorted with $near operation. The CPU usage would definitely rise up to 100%.

I heard mongodb already supported multi-core, but when the geo-query running, I started another mongo shell and input a very simple query db.test1.find().limit(1) (note that I even use a different collection), it stucked. The result came out only after my geo-query finishing.

I am confused, it seems that mongodb only suppoted single core for the long running read op. Is that true? I am using mongo 2.4.5


edit: even if I use a different database, it will still stuck.

edit: i use iostat -xm 2, when the long query running, all the disk I/O stop, %util almost 0. Memory usage is around 12%. So I am pretty sure the condition caused by high CPU usage.

Was it helpful?

Solution

It is confirmed as a bug now. https://jira.mongodb.org/browse/SERVER-11516

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top