SoapUI压力测试 SQLServer 报Connection reset

[ERROR]-[Thread: http-nio-83-exec-148]-[com.jfinal.core.ActionHandler.handle()]: /
com.jfinal.plugin.activerecord.ActiveRecordException: com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset
	at com.jfinal.plugin.activerecord.Model.find(Model.java:690)
	at com.jfinal.plugin.activerecord.Model.find(Model.java:703)
	at com.jfinal.plugin.activerecord.Model.find(Model.java:1051)
	at com.jiaojiao.controller.IndexController.getOptimumsPage(IndexController.java:688)
	at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:75)
	at com.jfinal.core.ActionHandler.handle(ActionHandler.java:81)
	at com.jiaojiao.websocket.WebSocketHandler.handle(WebSocketHandler.java:23)
	at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:89)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1667)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1654)
	at com.microsoft.sqlserver.jdbc.TDSChannel.read(IOBuffer.java:1789)
	at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(IOBuffer.java:4881)
	at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:6150)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:402)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:285)
	at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:227)
	at com.jfinal.plugin.activerecord.Model.find(Model.java:678)
	at com.jfinal.plugin.activerecord.Model.find(Model.java:688)
	... 29 more

[ERROR]-[Thread: http-nio-83-exec-147]-[com.alibaba.druid.pool.DruidDataSource.recycle()]: recyle error
com.microsoft.sqlserver.jdbc.SQLServerException: 该连接已关闭。
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(SQLServerConnection.java:388)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.clearWarnings(SQLServerConnection.java:2145)
	at com.alibaba.druid.pool.DruidConnectionHolder.reset(DruidConnectionHolder.java:313)
	at com.alibaba.druid.pool.DruidDataSource.recycle(DruidDataSource.java:1839)
	at com.alibaba.druid.pool.DruidPooledConnection.recycle(DruidPooledConnection.java:323)
	at com.alibaba.druid.pool.DruidPooledConnection.close(DruidPooledConnection.java:268)
	at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.jfinal.plugin.activerecord.SqlReporter.invoke(SqlReporter.java:58)
	at com.sun.proxy.$Proxy15.close(Unknown Source)
	at com.jfinal.plugin.activerecord.Config.close(Config.java:247)
	at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:331)
	at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:1290)
	at com.jfinal.plugin.activerecord.Db.find(Db.java:691)
	at com.jiaojiao.controller.IndexController.getOptimumsPage(IndexController.java:699)
	at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:75)
	at com.jfinal.core.ActionHandler.handle(ActionHandler.java:81)
	at com.jiaojiao.websocket.WebSocketHandler.handle(WebSocketHandler.java:23)
	at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:89)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)


评论区

杜福忠

2019-07-11 18:27

我猜是: DruidPlugin dp = new DruidPlugin("localhost", "userName", "password").set(初, 小, 大);连接数
后面三个值加大, 数据库有多少, 给多少试试

7479chen

2019-07-12 08:26

@杜福忠 数据库里是0不限制,我目前设置(10, 50, 1000)

JFinal

2019-07-12 10:25

@7479chen 改用 jfinal 提供的 HikariCpPlugin 代替 DruidPlugin 试一下,这个性能要高很多

7479chen

2019-07-12 15:38

@JFinal 谢谢波总,性能上确实提升很多

JFinal

2019-07-12 15:46

@7479chen Hikari 大概率是当今世界最快的 java 数据源连接池, druid 有很多别的功能,必然会拖慢性能