View MySQL lock condition

Source: Internet
Author: User

SHOW STATUS like '%table_locks% '

Table_locks_immediate | 105 |

table_locks_waited | 3 |

If the value of the table_locks_waited is higher, then there is a more serious table-level lock contention condition. At this point, we need to do a further review of the application to determine where the problem lies.

Table_locks_immediate refers to the number of times a table-level lock can be obtained immediately, while table_locks_waited refers to the number of times a table-level lock cannot be acquired immediately. If the value of table_locks_waited is larger, and you are experiencing performance problems, you may want to divide the large table into smaller tables, for example, you can create a proprietary cache table for a custom module, or otherwise reduce the size of the table. or reduce the frequency of table-level lock command calls. For some tables, such as Cache_*,watchdog, and Accesslog tables, one way to reduce the size of a table is to reduce the life cycle of the data.

View MySQL lock condition

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.