Error Message "connection established slowly"
Scenario
During peak hours, the connection between a client and an RDS for MySQL instance often times out. As a result, it takes more than 10 seconds to log in to the instance.
Possible Causes
- View error logs of the instance to check whether the information "connection xxx is established slowly" is displayed. Example:
If yes, some connections have timed out and have not been processed by the RDS for MySQL instance yet. When the connection between a client and the instance exceeds the specified timeout duration, an error is reported.
- Check the thread pool configuration (enabled by default) on the console.
In the preceding figure, threadpool_oversubscribe is set to 3. The wait time for the thread pool to process connections is related to this parameter.
Solution
If there are a large number of new connections, increase the value of threadpool_oversubscribe to increase the total number of threads. This reduces the overhead of repeated thread creation and destruction, and limits the number of running threads to protect the system against avalanche.
In normal cases, the thread pool is used when there are a large number of short connections. If persistent connections are used and there are a few connections (for example, the client uses a connection pool), the thread pool is not so helpful. In this case, adjust the value of threadpool_oversubscribe to increase the total number of threads, or close the thread pool.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot