整理服务器配置文件参数
发现table_cache参数在mysql手册和网络上mysql优化中的解释不一致 
在此向大家求证一下
mysql手册5.1.51中解释为:
table_cache  global numeric
所有线程打开的表的数目。增大该值可以增加mysqld需要的文件描述符的数量。你可以检查Opened_tables状态变量来检查你是否需要增加表缓存。如果Opened_tables值较大,并且多次执行FLUSH TABLES(只是强制关闭所有表并重新),则应增加table_cache变量的值。
在网上看到博文中的总结是:
table_cache指定表高速缓存的大小。每当MySQL访问一个表时,如果在表缓冲区中还有空间,该表就被打开并放入其中,这样可以更快地访问表内容。通过检查峰值时间的状态值Open_tables和Opened_tables,可以决定是否需要增加table_cache的值。如果你发现open_tables等于table_cache,并且opened_tables在不断增长,那么你就需要增加table_cache的值了(上述状态值可以使用SHOW STATUS LIKE ‘Open%tables’获得)。注意,不能盲目地把table_cache设置成很大的值。如果设置得太高,可能会造成文件描述符不足,从而造成性能不稳定或者连接失败。
但是mysql中没有这个变量:
mysql> show variables like 'table_cache';
Empty set (0.00 sec)
一个是线程打开表的数量 一个是高速缓存的大小 高速缓存的大小=线程打开表的数目?

解决方案 »

  1.   

    MySQL is multi-threaded, so there may be many clients issuing queries for a given table simultaneously. To minimize the problem with multiple client threads having different states on the same table, the table is opened independently by each concurrent thread. The table cache is used to cache file descriptors for open tables and there is a single cache shared by all clients. Increasing the size of the table cache allows mysqld to keep more tables open simultanously by reducing the number of file open and close operations that must be done. If the value of Open_tables is approaching the value of table_cache, this may indicate performance problems. 
    以手册为准吧。
      

  2.   

    但在mysql中查这个变量怎么没有了呢 是不是已经取消了?已经不是系统变量了?
    我的mysql版本是5.1.51 
    mysql> show status like 'table_cache';
    Empty set (0.01 sec)mysql> show variables like 'table_cache';
    Empty set (0.00 sec)mysql> show variables like '%version%';
    +-------------------------+---------------------+
    | Variable_name           | Value               |
    +-------------------------+---------------------+
    | protocol_version        | 10                  |
    | version                 | 5.1.51              |
    | version_comment         | Source distribution |
    | version_compile_machine | i686                |
    | version_compile_os      | pc-linux-gnu        |
    +-------------------------+---------------------+
    5 rows in set (0.01 sec)
      

  3.   

    http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_table_cache
    This is the old name of table_open_cache before MySQL 5.1.3. From 5.1.3 on, use table_open_cache instead.
    5.1.3开始,使用的是table_open_cache了。root@localhost : (none) 04:54:30> show global variables like 'table_open_cache';
    +------------------+-------+
    | Variable_name    | Value |
    +------------------+-------+
    | table_open_cache | 1024  |
    +------------------+-------+
    1 row in set (0.00 sec)
      

  4.   


    哦 原来这样啊
    在请教一个参数啊 skip-slave-start 这个参数在手册的系统变量中也找不到
    在mysql中查也没有 
    mysql> show variables like '%skip_slave_start';
    Empty set (0.00 sec)mysql> show status like '%skip_slave_start';
    Empty set (0.00 sec)
    这个参数是废弃掉了?还是改名字了?
    请赐教啊