MySQL InnoDB hangs on waiting for table-level locks

前端 未结 6 2030
抹茶落季
抹茶落季 2021-02-04 14:04

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

6条回答
  •  孤街浪徒
    2021-02-04 14:23

    Have you considered using MyISAM instead of InnoDB?

    If you are not utilizing any transactional features, MyISAM might make more sense. Its simpler, easier to optimize, and since it doesn't have sophisticated transactional capabilities, easier to configure in your my.cnf.

    Also, depending on the type of db load your app creates, MyISAM might be more appropriate. I prefer MyISAM for read-heavy applications, again, it's easier to configure and understand.

    Other suggestions:

    • It might be a good idea to find a way to not use NAME_CONST in your SQL. "This function was added in MySQL 5.0.12. It is for internal use only." When the documentation of an open source product says this, its probably a good idea to heed it's advise.

    • By default, MySQL stores all InnoDB tables & schemas data in 1 enormous file, there could be some kind of OS level locking on that particular file that propogates to MySQL that prevents all table access. By using the innodb_file_per_table option , you may eliminate that potential issue. This also makes MySQL more space efficient.

提交回复
热议问题