SHOW GLOBAL STATUS LIKE 'open%tables%';
Opened_tables -> 36417384SHOW VARIABLES LIKE 'table%cache';table_open_cache -> 3072目前是3072,总共有150-200个表,30个左右MyISAM,其他都是InnoDB,启用了分区。

解决方案 »

  1.   

    没有亲手接触过的东西谁都说不准的。如果你发现open_tables等于table_cache,并且opened_tables在不断增长,那么你就需要增加table_cache的值了。不能盲目地把table_cache设置成很大的值。如果设置得太高,可能会造成文件描述符不足,从而造成性能不稳定或者连接失败。
      

  2.   

    这个是tunning-primer给出的结果
    TABLE CACHE
    Current table_open_cache = 3072 tables
    Current table_definition_cache = 256 tables
    You have a total of 183 tables
    You have 1601 open tables.
    The table_cache value seems to be fine
    这个是mysqltuner.pl给的警告
    [!!] Table cache hit rate: 0% (1K open / 36M opened)
      

  3.   

    max_connections = 800so change the table_open_cache -> max_connections * number of tables?