title: Magento Mysql tuning - table cache
body: <p>I'm trying to tune my Magento DB for optimal performance.</p>
  
  <p>I'm running nginx, php-fpm and mysql on a 4GB RAM, 8CPU core virtual machine with 4GB of RAM.</p>
  
  <p>I've ran the Mysql Tuning Primer and everything looks good apart from my Table Cache:</p>
  
  <pre><code>TABLE CACHE
  Current table_open_cache = 1000 tables
  Current table_definition_cache = 400 tables
  You have a total of 2510 tables
  You have 1000 open tables.
  Current table_cache hit rate is 3%
  , while 100% of your table cache is in use
  You should probably increase your table_cache
  You should probably increase your table_definition_cache value.
  </code></pre>
  
  <p>and from mysqltuner</p>
  
  <pre><code>[!!] Table cache hit rate: 9% (1K open / 10K opened)
  [!!] Query cache efficiency: 0.0% (0 cached / 209 selects)
  </code></pre>
  
  <p>The relevant settings from the my.cnf file:</p>
  
  <pre><code>table_cache            = 1000
  query_cache_limit = 1M
  query_cache_size        = 64M
  </code></pre>
  
  <p>The thing is, no matter what I increase my table_cache to - it seems to be consumed almost immediately. Is this normal for Magento? It seems abnormally high?</p>
  
  <p>Does anyone have any tips about what I can do to improve this?</p>
  
  <p>Thanks,</p>
  
  <p>Ed</p>