==============================================================================
(1)最暴力,最简单
druid 的版本:
https://blog.csdn.net/mj158518/article/details/53091064
最新进展:大大们已经修复了,更新到1.0.27版本即可。
删除掉 /WEB-INF/lib/druid-1.0.5.jar,升级到最新的druid-1.1.9.jar版本试试。
==============================================================================
(2) 查看
msyql> show global variables like '%timeout%';
设置mysql server超时时间(以秒为单位):
最小设置
msyql> set global wait_timeout=28800;
msyql> set global interactive_timeout=28800;
https://www.cnblogs.com/netcorner/p/4380949.html
最大连接数:
mysql>show variables like 'max_connections';
=============================================================================
(3)druid与mysql的配置
就是在jdbc.properties里配置的
https://blog.csdn.net/wsf568582678/article/details/53636747
vi /usr/local/tomcat7/webapps/dsideal_yy/WEB-INF/classes/jdbc.properties
driverClass = com.mysql.jdbc.Driver jdbcUrl = jdbc\:mysql\://127.0.0.1\:22066/dsideal_db?useUnicode\=true&characterEncoding\=UTF-8&rewriteBatchedStatements\=true&allowMultiQueries\=true user = root password = ****** devMode = true memcached_url=127.0.0.1\:11211 mysql.maxActive = 50 mysql.initialSize = 3 mysql.minIdle = 10 mysql.maxWait = 30000 mysql.validationQuery = select 1 mysql.timeBetweenEvictionRunsMillis = 30000 mysql.timeWileIdle = true
很明显,我们的平台中没有设置druid的超时时间,回收时间等,也不知道默认值是多少,有点盲人摸象的感觉...
参考资料:
https://www.cnblogs.com/chihirotan/p/6253175.html
如果实在找不到原因,就死马权当活马医:
vi /etc/my.cnf
wait_timeout=31536000 interactive_timeout=31536000
==============================================================================
(3) ulimit -a
发现打开文件数太小,只有1024
ulimit -n 65535
http://www.cnblogs.com/shengs/p/4167239.html