table_open_cache Open_tables Opened_tables
来源:互联网 发布:beta系数 知乎 编辑:程序博客网 时间:2024/06/06 02:37
table_open_cache
指定表高速缓存的大小。
每当MySQL访问一个表时,如果在表缓冲区中还有空间,该表就被打开并放入其中,这样可以更快地访问表内容。
通过检查峰值时间的状态值Open_tables和Opened_tables,可以决定是否需要增加table_open_cache的值。
如果你发现open_tables等于table_open_cache,并且opened_tables在不断增长,那么你就需要增加table_open_cache的值了(上述状态值可以使用SHOW GLOBAL STATUS LIKE ‘Open%tables’获得)。
注意,不能盲目地把table_open_cache设置成很大的值。如果设置得太高,可能会造成文件描述符不足,从而造成性能不稳定或者连接失败。
mysql> show variables like '%table_open_cache%';
+----------------------------+-------+| Variable_name | Value |
+----------------------------+-------+
| table_open_cache | 8192 |
| table_open_cache_instances | 1 |
+----------------------------+-------+
2 rows in set (0.00 sec)
mysql> show global status like '%open%';
+----------------------------+------------+
| Variable_name | Value |
+----------------------------+------------+
| Com_ha_open | 0 |
| Com_show_open_tables | 0 |
| Innodb_num_open_files | 1024 |
| Open_files | 112 |
| Open_streams | 0 |
| Open_table_definitions | 4330 |
| Open_tables | 4557 |
| Opened_files | 156740806 |
| Opened_table_definitions | 21563119 |
| Opened_tables | 172504016 |
| Slave_open_temp_tables | 0 |
| Table_open_cache_hits | 1609800574 |
| Table_open_cache_misses | 18769556 |
| Table_open_cache_overflows | 18733120 |
+----------------------------+------------+
14 rows in set (0.00 sec)
mysql> show global status like '%open%';
+----------------------------+------------+
| Variable_name | Value |
+----------------------------+------------+
| Com_ha_open | 0 |
| Com_show_open_tables | 0 |
| Innodb_num_open_files | 1024 |
| Open_files | 112 |
| Open_streams | 0 |
| Open_table_definitions | 4395 |
| Open_tables | 4685 |
| Opened_files | 156741147 |
| Opened_table_definitions | 21563184 |
| Opened_tables | 172509760 |
| Slave_open_temp_tables | 0 |
| Table_open_cache_hits | 1609879796 |
| Table_open_cache_misses | 18769684 |
| Table_open_cache_overflows | 18733120 |
+----------------------------+------------+
14 rows in set (0.00 sec)
如果show processlist显示很多opening table closing table很多,那么就应该调整这些参数了
- table_open_cache Open_tables Opened_tables
- Open_tables Opened_tables table_open_cache
- table_open_cache
- table_open_cache太大引发的问题
- MySQL的table_cache/table_open_cache参数
- MYSQL实践心得:table_open_cache…
- table_open_cache参数对mysql性能的影响
- table_open_cache参数对mysql性能的影响
- MYSQL实践心得:table_open_cache的设置
- MYSQL实践心得:table_open_cache的设置
- PHP-mysql数据库类
- Sizeof与Strlen的区别与联系
- ASIHTTPRequest类库简介和使用说明
- android sd卡的位置
- python列表去除重复元素
- table_open_cache Open_tables Opened_tables
- JS解析XML
- Android系统中的广播(Broadcast)机制简要介绍
- 50个最常用的UNIX/Linux命令
- Android的异步加载AsyncTask方式Http请求的封装(改进版)
- JSON
- 上台阶,上三下二
- FZU2105 Digits Count(经典 线段树)
- MySQL5.0版本的安装图解