Mysql – increasing thesql table open cache

innodbMySQLmysql-5.5

I often read that it is best to increase this variable slowly. Can someone explain why? My status indicates that I should increase it… What is best practice / "slowly"?

Thanks!

Best Answer

Since you are using InnoDB with innodb_file_per_table enabled, you need to raise innodb_open_files because this dictates the number of open file handles on .ibd files.

In MySQL 5.6, this setting is treated a little different.

This variable is relevant only if you use multiple InnoDB tablespaces. It specifies the maximum number of .ibd files that MySQL can keep open at one time. The minimum value is 10. As of MySQL 5.6.6, the default value is 300 if innodb_file_per_table is not enabled, and the higher of 300 and table_open_cache otherwise. Before 5.6.6, the default value is 300.

The file descriptors used for .ibd files are for InnoDB tables only. They are independent of those specified by the --open-files-limit server option, and do not affect the operation of the table cache. For general I/O tuning advice, see Section 8.5.7, “Optimizing InnoDB Disk I/O”.

Here is an additional reference from MySQL Performance Blog about setting innodb_open_files.

Raising innodb_open_files to a big number should not be that all that troublesome, but please be sensible about the number you choose.