MySQL performance optimization Open_Table configuration parameter configuration recommendations
- 2020-06-23 02:04:13
- OfStack
In the MySQL database, Opened_tables represents the number of open tables, and the reasonable configuration of MySQL Open_Table is described in detail below.
MySQL Opened_tables represents the number of tables that have been opened. Here's how to properly configure MySQL Open_Table.
MySQL Open_Table
mysql> show global status like 'open%tables%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Open_tables | 919 |
| Opened_tables | 1951 |
+---------------+-------+
MySQL Open_tables represents the number of open tables. If the number of MySQL Opened_tables is too large, it means that the value of table_cache in the configuration (after 5.1.3, the value is called table_open_cache) may be too small. We query 1 for the value of server table_cache:
mysql> show variables like 'table_cache';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| table_cache | 2048 |
+---------------+-------+
The appropriate value of MySQL Open_Table is:
Open_tables / Opened_tables * 100% >= 85%
Open_tables / table_cache * 100%