starting mongod spent too long when the number of dbs grow large

12 views
Skip to first unread message

Elmer Zhang

unread,
Aug 11, 2011, 12:36:57 PM8/11/11
to mongod...@googlegroups.com
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.

Chris Westin

unread,
Aug 12, 2011, 2:58:36 PM8/12/11
to mongodb-user
It sounds like that could be optimized, so I submitted
https://jira.mongodb.org/browse/SERVER-3588 .

Chris

Chris Westin

unread,
Aug 12, 2011, 3:01:35 PM8/12/11
to mongodb-user
Could you please update that with the version you tried this on?

Chris

Elmer Zhang

unread,
Aug 12, 2011, 10:03:59 PM8/12/11
to mongod...@googlegroups.com
I tried this on 1.6.5, 1.8.1, 1.8.2.

2011/8/13 Chris Westin <chrisw...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


Reply all
Reply to author
Forward
0 new messages