• notice
  • Congratulations on the launch of the Sought Tech site

MySQL responds to network jitter issues

By default, MySQL itself disconnects via various TIMEOUT parameters.

Various interpretations of TIMEOUT:

connect_timeout plays a role in establishing a connection.It is recommended to increase the value when using connection pooling or poor network conditions.Interactive_timeout and wait_timeout Interactive and non-interactive links are mainly applicable to the idle phase of the connection.net_read_timeout and net_write_timeout are mainly the timeout of the busy phase of the connection during read or write.

Specific example:

1.Can't connect to MySQL server.

Lost connection to MySQL server at 'reading authorization packet', system error: 0

In the connection handshake stage, the connection may fail due to network jitter.Increasing connect_timeout can solve this problem.This will cause the problem of engine MySQL thread occupancy.If possible, reconnect appropriately without increasing the timeout.

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

After TCP handshakes multiple times to establish a connection, after checking the username and password, and IP->HOST->DNS->IP verification, any step may cause thread blocking due to network problems.This is mainly due to DNS instability.If possible, add "skip-name-resolve" to the configuration file to reduce the time of 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 others.

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

This article is from the blog "Technology Achieves Dreams", please keep this source http://weipengfei.blog.51cto.com/1511707/1117101


Technical otaku

Sought technology together

Related Topic


Leave a Reply