-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
com.alibaba:druid:1.1.20 MysqlUtils写死了mysql-connector-java 5.1版本的MySQLConnection类加载,导致线程阻塞,性能受限 #3808
Comments
mysql-connector-java 降低到5.1.49,同时mysql driver-class 从 com.mysql.cj.jdbc.Driver 改为 com.mysql.jdbc.Driver 性能得到有效提高 |
我也碰到了,mysql-connector 8.X的驱动,从代码看,当idleMillis >= timeBetweenEvictionRunsMillis就会出现这个问题 |
`/*
import java.lang.reflect.Constructor; import javax.sql.XAConnection; import com.alibaba.druid.sql.SQLUtils; public class MySqlUtils {
} |
可以试下我贴的代码,把MySqlUtils文件替换下,再压下 |
看了下更新的,改成这样了,终于不报错了.... |
我也遇到了。。。还很隐蔽,突然一波tomcat连接线程的busy。抓了线程栈,分析才找到这里 |
升级新版 mysql-connector-java至8.0.x后,系统进行压测,出现
大量线程阻塞,发现
class_connectionImpl = Utils.loadClass("com.mysql.jdbc.MySQLConnection"); 中的 com.mysql.jdbc.MySQLConnection在新版本中不存在,同时
Utils.loadClass方法类加载生吞了异常,所以代码逻辑会频繁对不存在的类进行类加载
The text was updated successfully, but these errors were encountered: