•Table_locks_immediate The number of times that a request for a table lock could be granted immediately. •Table_locks_waited The number of times that a request for a table lock could not be granted immediately and a wait was needed. If this is high and you have performance problems, you should first optimize your queries, and then either split your table or tables or use replication. 实际上应该关心的是Table_locks_waited的值 这是我们服务器上的一个值 mysql> show global status like 'table%'; +-----------------------+---------+ | Variable_name | Value | +-----------------------+---------+ | Table_locks_immediate | 1147514 | | Table_locks_waited | 135 | +-----------------------+---------+
如果Table_locks_immediate / Table_locks_waited > 5000,最好采用InnoDB引擎,
因为InnoDB是行锁而MyISAM是表锁,对于高并发写入的应用InnoDB效果会好些。
示例中的服务器Table_locks_immediate / Table_locks_waited = 235,MyISAM就足够了。
你的情况很不错
看的方法看1L 2L
我仔细看了 是有问题。。我觉得这个值应该越小越好 。。
只要够小 使用Myisam引擎就够了。。Table_locks_immediate / Table_locks_waited > 5000,最好采用InnoDB引擎
这句话我也认为是错误的
The number of times that a request for a table lock could be granted immediately. •Table_locks_waited
The number of times that a request for a table lock could not be granted immediately and a wait was needed. If this is high and you have performance problems, you should first optimize your queries, and then either split your table or tables or use replication. 实际上应该关心的是Table_locks_waited的值
这是我们服务器上的一个值
mysql> show global status like 'table%';
+-----------------------+---------+
| Variable_name | Value |
+-----------------------+---------+
| Table_locks_immediate | 1147514 |
| Table_locks_waited | 135 |
+-----------------------+---------+