Copied from http://groups.google.com/group/mongodb-user/browse_thread/thread/a1b73e36b6be0b92 :
When number of database grow large, mongod will spent very long time to start.
I have about 23500 databases in dbpath, and starting mongod will spent about 45 mins.
I read the source code of mongod and used strace to watch what mongod do while starting. I found that mongod open all databases to check the pdfile version while starting. When mongod open a database, it call "getDatabaseNames", and "getDatabaseNames" will call file stat for about N (N is the number of databases) times. So mongod will call stat about N * N times while checking the pdfile version of all databases. This will spent too long time.