Mysql database insertion speed and read speed adjustment, mysql database

Source: Internet
Author: User

Mysql database insertion speed and read speed adjustment, mysql database

Reading and inserting updates of millions of data in mysql is normal, but the speed will be slow after tens of millions. How to adjust the configuration to improve efficiency. As follows:

1. Try to write data to DataFile at a time and reduce the checkpoint operation of the database. Adjust the following parameters:

(1) set innodb_flush_log_at_trx_commit to 0, and set it to 0 based on past experience, which greatly improves the insertion speed.

(2) Adjust the innodb_autoextend_increment configuration from 8 MB to 128 MB by default.

(3) Adjust the Innodb_log_buffer_size configuration from 1 MB to 16 MB by default. Increase the log cache to reduce the number of write data files.

(4) Adjust the innodb_log_file_size configuration from 8 MB to 128 MB by default. Set the undo log size to reduce the database checkpoint operation.

After the above adjustments, the system insertion speed will be greatly improved. Note: The above parameter adjustments are also adjusted based on different machine configurations.

 

2. Improve the reading speed of the database and improve the reading speed at the database level mainly from the following aspects: simplifying SQL statements, adding indexes, and adding extra points.

 

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.