【发布时间】:2019-12-18 05:42:29
【问题描述】:
后端应用是在play框架中开发的。 连接到 2 个不同的数据库 mysql 和 oracle。
2 到 3 小时后,CPU 消耗达到 100%。
在部署 6 个月后,我找不到相同问题的确切根本原因。但是在 Windows 事件查看器中,我发现 MYsql 出现以下错误
WindowsEventViewer 日志
Aborted connection 472 to db: 'mydb' user: 'root' host: 'localhost' (写入通信数据包时出错)有关更多信息,请参阅帮助和支持中心http://www.mysql.com。
在 mysql 的 WINSERVER.err 中找到的日志
2019-12-18T05:07:35.110436Z 472 [注意] 中止连接 472 到 db: “mydb”用户:“root”主机:“localhost”(写入时出错 通讯包)
我在整个应用程序中使用的应用程序开始时创建一个数据库连接。
我的数据库配置
db.mydb.hikaricp.minimumIdle=2 db.mydb.hikaricp.maximumPoolSize=4 db.mydb.hikaricp.idleTimeout=600000 #### 10 分钟 db.mydb.hikaricp.maxLifetime=1800000 #### 30 分钟 db.mydb.hikaricp.cachePrepStmts=true db.mydb.hikaricp.prepStmtCacheSize=250 db.mydb.hikaricp.prepStmtCacheSqlLimit=2048 db.mydb.hikaricp.useServerPrepStmts=true db.mydb.hikaricp.useLocalSessionState=true db.mydb.hikaricp.rewriteBatchedStatements=true db.mydb.hikaricp.cacheResultSetMetadata=true db.mydb.hikaricp.cacheServerConfiguration=true db.mydb.hikaricp.elideSetAutoCommits=true db.mydb.hikaricp.maintainTimeStats=false
【问题讨论】:
标签: java mysql playframework