Priority: Major - P3
Affects Version/s: 3.4.6
Fix Version/s: None
When using a lot of DBs (few thousands) mongod process take a lot of time to boot (minutes) and takes a lot of system resources afterwards.
Until boot is complete (minutes) the DB doesn't accept client connections.
It open all storage files (one per every collection and per index in every DB) + consumes a lot of memory. For 2000 DBs with 10 collections and 5 indexes per collection, there will be 100000 open file handlers.
On our use-case, we keep the DBs but access them rarely, usually only few DBs are relevant at any given moment.
I would expect mongo to lazy load the DBs when first connection is made.
(and hopefully unload if no active connection for a while)