MySQL Configuration optimization

Source: Internet
Author: User

MySQL configuration:

1, use Innodb_flush_method=o_direct to avoid writing when the double buffer.

2. Avoid using O_direct and EXT3 file systems-This will serialize everything written.

3. Allocate enough innodb_buffer_pool_size to load the entire InnoDB file into memory-reducing read from disk.

4, do not let innodb_log_file_size too large, so that it can be faster, there is more disk space-often refreshing to reduce the recovery time when the failure.

5. Do not use innodb_thread_concurrency and thread_concurrency variables at the same time-these two values are not compatible.

6. Specify a small value for max_connections-too many connections will drain your RAM and cause the entire MySQL server to be locked.

7. Keep the thread_cache in a relatively high value, approximately 16-prevents the speed drop when the connection is opened.

8. Use skip-name-resolve-to remove DNS lookups.

9, if your query repetition rate is high, and your data does not change frequently, use query caching-however, using query caching on frequently changing data can negatively affect performance.

10, increase temp_table_size-prevent disk write.

11, increase max_heap_table_size-prevent disk write.

12. Do not set the value of sort_buffer_size too high-it may cause the connection to run out of all memory quickly.

13, monitoring key_read_requests and key_reads, in order to determine the value of Key_buffer-key read demand should be higher than key_reads, otherwise use key_buffer will not be efficient.

14, Set Innodb_flush_log_at_trx_commit = 0 can improve performance, but to maintain the default value (1), can guarantee the integrity of the data, but also to ensure that replication does not lag.

15, there is a test environment, easy to test your configuration, can be restarted frequently, does not affect the production environment.

MySQL Configuration optimization

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.