异常日志
The last packet successfully received from the server was 15,788,990 milliseconds ago. The last packet sent successfully to the server was 15,788,991 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
Communications link failure The last packet successfully received from the server was 11,299,507 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.
| 物理连接的超时时间,超时关闭 (毫秒):736001000 [20230505]由于服务端设置的是36001000 此处修改为30001000 | 编辑 | |
| ------------------------------------------------------------------------------------------------------------ | ------ | -- |
根因:由于MySQL服务端设置连接时长为3600s,应用端采用的是Duird连接池其中有配置phyTimeoutMillis设置连接保持时间,应用端设置的为7✖️3600✖️1000七个小时,远大于MySQL设置的连接失效时长。
解决:减少phyTimeoutMillis参数的物理连接时长为3000✖️1000,得解
标题:记一次生产Druid连接池Communications link failure异常
作者:JonLv
地址:http://39.108.183.139:8080/articles/2023/05/05/1683281639731.html