The number of MySQL handles takes up too much workaround _mysql

Source: Internet
Author: User
Tags flush

Install MySQL under Windows, with the Official Configuration Wizard generated My.ini, this thought very stable, who knows more than 10 hours past, the system response is very slow, look at the performance of the Resource Manager card, found that the number of handles unexpectedly reached 100,000! No wonder that whatever program you use is very good.

Online search, probably said innodb_buffer_pool_size this default 8M too large, but I have skip-innodb ah.

And then I saw a setup Innodb_flush_log_at_trx_commit

Innodb_flush_log_at_trx_commit (This works well)

Complaining that InnoDB is 100 times times slower than MyISAM? So you probably forgot to adjust the value. The default value of 1 means that every instruction outside the transaction commit or transaction needs to write the log to the (flush) hard disk, which is time consuming. Especially when using battery-powered caching (Battery backed up cache). Set to 2 for many applications, especially from the MyISAM table, it means that the system cache is written without writing to the hard disk. The log still flush to the hard drive every second, so you won't normally lose more than 1-2 seconds of updates. Set to 0 will be faster, but the security aspect is poor, even if MySQL hangs may lose the transaction data. A value of 2 only loses data when the entire operating system hangs.

  It was later set to Innodb_flush_log_at_trx_commit = 2.

Restart the MySQL service, indeed a lot better, the number of handles finally remained around 20,000, in a stable state, the other programs are much faster.

It seems that in the configuration file InnoDB even if skip, still use the system memory, disk IO, it seems to the MySQL configuration or manual research, can not rely entirely on the configuration tool.

summed up, for the InnoDB type of library, the Innodb_flush_log_at_trx_commit set to 2, can improve the performance of MySQL, handle the problem of too much.

The above is to solve the MySQL handle occupy too much of the method, I hope to give you a reference to learn more about MySQL syntax, we can pay attention to the MySQL 5.1 reference manual, but also hope that we support cloud habitat community.

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.