MySQL table lock status and number of opened files

Source: Internet
Author: User

In the MySQL database, we need to adjust some system parameters according to the database status. The following describes how to adjust the MySQL table lock and the number of opened files for your reference.

Open_files)

 
 
  1. Mysql> show global status like 'open _ files ';
  2. + --------------- + ------- +
  3. | Variable_name | Value |
  4. + --------------- + ------- +
  5. | Open_files | 1410 |
  6. + --------------- + ------- +
  7. Mysql> show variables like 'open _ files_limit ';
  8. + ------------------ + ------- +
  9. | Variable_name | Value |
  10. + ------------------ + ------- +
  11. | Open_files_limit | 4590 |
  12. + ------------------ + ------- +
  13. Suitable settings: Open_files/open_files_limit * 100%

MySQL table locks

 
 
  1. mysql> show global status like 'table_locks%';  
  2. +-----------------------+-----------+  
  3. | Variable_name | Value |  
  4. +-----------------------+-----------+  
  5. | Table_locks_immediate | 490206328 |  
  6. | Table_locks_waited | 2084912 |  
  7. +-----------------------+-----------+ 

Table_locks_immediate indicates the number of MySQL table locks to be released immediately, and Table_locks_waited indicates the number of MySQL table locks to wait. If Table_locks_immediate/Table_locks_waited> 5000, InnoDB engine is recommended, because InnoDB is a row lock and MyISAM is a MySQL table lock, InnoDB is better for highly concurrent writes. In the example, the server Table_locks_immediate/Table_locks_waited = 235, and MyISAM is enough.

MySQL query cache Variables

How to enable MySQL slow Query

Mysql multi-Table query implementation

How to deal with MySQL function creation Problems

Connection between MySQL stored procedures and databases

Related Article

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.