How much memory does the MySQL server variable table_open_cache cause the DBMS to use? Simple question, but I have been unable to find simple answers.
So the default value for the table_open_cache server variable is 2000. Which means 2000 slots for 2000 files. We can assume each slot takes a few bytes. As we are not discussing Table row data, but Table information. Perhaps 1K or memory each slot.
So, if we increase the cache size by a factor of 10, how much memory is then required by MySQL 5.7? And is the usage linear?
Let's look at it from another point of view -- Is table_open_cache too big or too small?
If Table_open_cache_overflows / Uptime &gt; 1 per second, then increase the setting.
If Table_open_cache_misses / Uptime &gt; 1/sec, then increase table_open_cache
If Table_open_cache_misses / (Table_open_cache_hits + Table_open_cache_misses) &gt; 3%, then increase table_open_cacheand checktable_open_cache_instances`.