Status: Needs Scheduling
Priority: Major - P3
Affects Version/s: 4.2.6
Fix Version/s: None
Mongos don't proactively clear the cached metadata unless it was the mongos that dropped it (or when it tries to perform an operation on a namespace that was already dropped), so cached metadata for dropped collections can stay in the cache forever. This can be problematic for use cases where sharded collections are constantly being created and dropped, as they in theory should net no additional memory required, but will cause mongos to slowly accumulate chunk metadata for old dropped collections.
Original title: mongos memory footprint keeps increasing
Machine type: Amazon Linux 2
Shard count: 5
Cluster Architecture: PSA
Config nodes: 3
Mongo Version: 4.2.6
We have a mongos running on each application server instance. The mongos seems to continuously keep on accumulating memory overtime until the mongos service is restarted.
I don't see a mongos configuration option (https://docs.mongodb.com/manual/reference/program/mongos/) to control the memory growth beyond a certain threshold. Can it be configurable like wiredTigerCacheSize?
This seems like a memory leak issue! Is there a way we can inspect what kind of mongos related data is stored in memory?
Attaching the serverStatus output..