In-depth Mysql concurrent Insert optimization detailed _mysql

Source: Internet
Author: User

When using storm to process logs, I often encounter the efficiency problem of concurrent insert MySQL, check some information on the Internet, do some notes

Change the table's engine to MyISAM,

Modify MY.CNF Concurrent_insert=2,concurrent_insert can be set to a value of 0 1 2, 2 is fully supported concurrent insert

1) Concurrent _insert =0, regardless of whether the MyISAM table data file exists because of the deletion and left the Russian free space, do not allow concurrent insert.

2 Concurrent_insert = 1 is the concurrent insert from the end of the file when there is no free space in the middle of the MyISAM Storage engine table data file.

3) Concurrent_insert = 2 allows concurrent inserts to be made at the end of the data file, regardless of whether the middle portion of the MyISAM Storage engine's table data file has free space left for deletion.

Restart MySQL:/etc/init.d/mysqld restart

When inserting data, it can also be set to insert delayed: Insert delayed into ' tablename ' ...

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.