I was restarting MySQL on box with 50.000 of Innodb tables and again it took couple of hours to reach decent performance because of "Opening Tables" stage was taking long.
Part of the problem is Innodb is updating stats on each table open which is possibly expensive operation, but really it is only great test case for general MySQL problem.
During warmup process I noticed I get very low CPU usage and disk Usage and IOWait about 25% (4CPU box) which indicates table opens and stats updates are serialized rather than performed in parallel.
I've checked with Heikki and he confirmed MySQL has global table cache mutex (LOCK_open) which is held for all open table operation so table opens are serialized.
Do not think however it is only Innodb problem. I've seen similar problems with MyISAM - these also take few IO operations to open and could take quite a while to close if there were unflushed key blocks and we have no …
[Read more]