[SERVER-34561] nearSphere use lots of memory and oom Created: 19/Apr/18  Updated: 04/Sep/18  Resolved: 03/Aug/18

Status: Closed
Project: Core Server
Component/s: Geo
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: shawn Assignee: Nick Brewer
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

2ds index queries use lots of memory , until mongod oom.

query patthern is :

command: find { find: "col_gps", filter: { gps: { $nearSphere: { $geometry: { type: "Point
", coordinates: [ 116.006216, 25.86062 ] } } } }, limit: 1, batchSize: 1, singleBatch: true } planSummary: GEO_NEAR_2DSPHERE { gps: "2dsphere" }

Thanks.



 Comments   
Comment by Nick Brewer [ 03/Aug/18 ]

shawn001 Sorry this ticket fell through the cracks. The larger issue of unbounded memory utilization with $near queries is documented here: SERVER-22224. To answer your question from that ticket:

is 3.6 affected also?

Yes, 3.6 is affected. This is an outstanding issue; when it is addressed, SERVER-22224 will be updated to include MongoDB versions that have received the necessary fix. 

In the meantime, I suggest using $maxDistance to improve the memory utilization of your query.

-Nick

Generated at Thu Feb 08 04:37:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.