MySQL and connection-related timeout

Source: Internet
Author: User

The following summarizes the connection-related timeouts slave-net-timeoutthe number of seconds to wait for more data from the master before the Slave considers The connection broken, aborts the read, and tries to reconnect. The first retry occurs immediately after the timeout. The interval between retries is controlled by the Master_connect_retry option for the change MASTER to statement, and the Number of reconnection attempts is limited by the--master-retry-count option. The default is 3600 seconds (one hour). When slave thinks the connection to master is problematic, wait for n seconds, and then disconnect, reconnect masternet_read_timeout:the number of Seconds to wait for more data from a connection before aborting the read. When the server was reading from the client, Net_read_timeout is the timeout value controlling time to abort before terminating the read, getting the number from a connection When the service is reading data from the client, net_read_timeout controls when the time-out occurs. Net_write_timeout:the number of seconds to wait for a block to is written to a connection before aborting the write. When the server was writing to the client, Net_write_timeout was the timeout value controlling when to abort. The number of seconds to wait for the block to write to the connection before terminating the write, and when the service is writing data to the client, the Net_write_timeout control when the time-out wait_timeoutthe is seconds the server waits for Activity on a noninteractive connection before closing it. The time to wait for a connection that is not interactive with the server until it is forcibly closed by the server side interactive_timeout:the Number of seconds the server waits for activity in an interactive connection before closing it. Connection to server without interaction until forced shutdown by server side Time Connect_timeoutthe number of seconds the MYSQLD server waits for a connect packet before responding with bad hand Shake. The default value is seconds. Time to wait for a connection response connect_timeout: In the Get connection phase (authenticate) functions Interactive_timeout and Wait_ Timeout: The connection idle phase (sleep) functions Net_read_timeout and Net_write_timeout: is in the connection busy stage (query) function. Getting a MySQL connection is the result of multiple handshakes, with IP->HOST->DNS->IP authentication in addition to the user name and password matching checks, which can cause a thread to block due to network problems. To prevent thread wasting on unnecessary check waits, connection requests that exceed connect_timeout will be rejected. Even if there is no network problem, you cannot allow the client to occupy the connection. For clients that maintain a sleep state that exceeds wait_timeout (or interactive_timeout, depending on the client_interactive flag), MySQL actively disconnects. MySQL chooses conditional waits even if the connection is not in sleep state, that is, the client is busy computing or storing data. During the distribution process of the packet, the client may be too late to respond (send, receive, or process packets too slowly). To ensure that the connection is not wasted in endless waits, MySQL also chooses to have the conditional (Net_read_timeout and Net_write_timeout) active disconnection.

Transfer from

MySQL and connection-related timeout

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.