Mysqlinsert speed is too slow

Source: Internet
Author: User

Mysqlinsert speed is too slow recently in the storage with MySQL, the test found that the insertion of data is too slow, the insertion speed of only 20

MY SQL Insert speed is too slow
Recently in the storage with MySQL, the test found that the insertion of data is too slow, the insertion speed of only 20-30/second, and later after the data, the MySQL 1 parameters: innodb_flush_log_at_trx_commit,1 changed to 0 (Modify the method, You can directly modify the corresponding parameters in My.ini (Windows)/my.cnf (Linux), as if the command directly set no effect), the insertion speed is increased to 3000+ per S,mysql document, the description of this parameter is as follows:
If the value of Innodb_flush_log_at_trx_commit is 0, the log buffer was written out to the log file once per second and the Flush to disk operation was performed on the log file and nothing was done at a transaction commit. When the value was 1 (the default), the log buffer is written out to the log file at each transaction commit and the flush To disk operation was performed on the log file. When the value was 2, the log buffer is written the-the file at each commit, but the flush to disk operation is not perf Ormed on it. However, the flushing on the log file takes place once per second also when the value is 2. Note that the Once-per-second flushing are not 100% guaranteed to happen every second, due to process scheduling issues.

Thus, if the frequency of transaction commit is very high, in 1 seconds will be done many times, you can consider to set it to 0, but this will bear the database crash, 1 seconds without storage to the database data loss potential risk

Mysqlinsert speed is too slow

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.