MySQL response to network jitter problem

Source: Internet
Author: User
Tags connection pooling thread

By default, MySQL itself breaks links through various timeout parameters.

Various interpretations of the timeout:

Connect_timeout is useful when establishing a connection, and is recommended for use with connection pooling or for poor network conditions. Interactive_timeout and wait_timeout Interactive and non-interactive links are primarily applicable to connection idle stages. Net_read_timeout and net_write_timeout are mainly connection timeouts during the busy phase of read or write.

Concrete Examples:

1, Can ' t connect to MySQL server.

Lost connection to MySQL Server at ' reading authorization packet ', System error:0

Adding connect_timeout can resolve this problem when the connection handshake may fail because of network jitter. This will engine MySQL thread occupancy problem, if possible without adding timeout, the appropriate reconnection.

2. Lost connection to MySQL server at ' reading initial communication ':

After TCP has repeatedly shook hands to establish a connection, after checking the username and password, there is IP->HOST->DNS->IP authentication, and any step may cause the thread to block due to network problems. This is due primarily to DNS instability. If you can, add "skip-name-resolve" to the configuration file to reduce the time of the domain name resolution.

3. Lost connection to MySQL server during query

This is more random. may be caused by net_read_timeout and net_write_timeout or other.

Reference article: http://www.realzyy.com/?p=491

This article is from the "Technology Achievement Dream" blog, please be sure to keep this source http://weipengfei.blog.51cto.com/1511707/1117101

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/MySQL/

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.