Database Down machine connection pool reaction test 2 (optical connection pool)

I received a lot of information from netizens today, and I feel very surprised. This test found a serious problem with the optical connection pool. What if the waiting time is set to be very large? Interested friends can test.

When the machine is down, the response time of BeeCP is very fast, and the subsequent request time is almost equal to the connection timeout time on the Socket. For further verification, first we write a JDBC URL to connect to mysql:

jdbc:mysql://localhost/test?connectTimeout=100&socketTimeout=100

I believe that friends who have a certain foundation know the meaning of the above URL parameter, in which connectTimeout is the timeout time of the Socket connection. For the purpose of testing, it is specially set to 100 milliseconds. Please see the screenshot below.

From the test situation in the above picture, the response time of the optical connection pool is more than 20 seconds, and it feels that it is not exciting enough to set the time to 50 milliseconds.

jdbc:mysql://localhost/test?connectTimeout=50&socketTimeout=100

 

 

{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324190894&siteId=291194637