MySQL性能优化之Open_Table配置参数的合理配置建议


在MySQL数据库中,Opened_tables表示打开过的表数量,下面将对MySQL Open_Table的合理配置作详细的说明介绍。

MySQL Opened_tables表示打开过的表数量,下文就将教您如何合理配置MySQL Open_Table的值,希望对您学习MySQL数据库能有所帮助。

MySQL Open_Table情况:

复制代码 代码如下:

mysql> show global status like 'open%tables%'; 
+---------------+-------+ 
| Variable_name | Value | 
+---------------+-------+ 
| Open_tables   | 919   | 
| Opened_tables | 1951  | 
+---------------+-------+

MySQL Open_tables表示打开表的数量,如果MySQL Opened_tables数量过大,说明配置中table_cache(5.1.3之后这个值叫做table_open_cache)值可能太小,我们查询一下服务器table_cache值:
复制代码 代码如下:

mysql> show variables like 'table_cache'; 
+---------------+-------+ 
| Variable_name | Value | 
+---------------+-------+ 
| table_cache   | 2048  | 
+---------------+-------+

MySQL Open_Table比较合适的值为:
复制代码 代码如下:

Open_tables / Opened_tables * 100% >= 85% 
Open_tables / table_cache * 100%


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3