mysql innodb表级锁,MySQL InnoDB挂起等待表级锁

I have a big production web-application (Glassfish 3.1 + MySQL 5.5). All tables are InnoDB. Once per several days application totally hangs.

SHOW FULL PROCESSLIST shows many simple insert or update queries on different tables but all having status

Waiting for table level lock

Examples:

update user

set user.hasnewmessages = NAME_CONST('in_flag',_binary'\0' COLLATE 'binary')

where user.id = NAME_CONST('in_uid',66381)

insert into exchanges_itempacks

set packid = NAME_CONST('in_packId',332149), type = NAME_CONST('in_type',1), itemid = NAME_CONST('in_itemId',23710872)

Queries with the longest 'Time' are waiting for the table-level lock too.

Please help to figure out why MySQL tries to get level lock and what can be locking all these tables. All articles about the InnoDB locking say this engine uses no table locking if you don't force it to do so.

My my.cnf has this:

innodb_flush_log_at_trx_commit = 0

innodb_support_xa = 0

innodb_locks_unsafe_for_binlog = 1

innodb_autoinc_lock_mode=2

Binary log is off. I have no "LOCK TABLES" or other explicit locking commands at all. Transactions are READ_UNCOMMITED.

解决方案

Are you using MSQLDump to backup your database while it is still being accessed by your application? This could cause that behaviour.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值