NutzCN Logo
问答 Nutz作为基础框架的后台服务,100并发测试就开始报错!
发布于 2844天前 作者 qq_1968473f 3340 次浏览 复制 上一个帖子 下一个帖子
标签:

Nutz作为基础框架的后台服务,100并发测试就开始报错!
SocketTimeoutException这种异常要怎么优化一下?

cpu 2核  
mem:4G内存
os: centos 7
tomcat: 8
nutz:1.6.0

org.nutz.json.JsonException: java.net.SocketTimeoutException
at org.nutz.json.impl.JsonTokenScan.readChar(JsonCompileImplV2.java:419)
at org.nutz.json.impl.JsonTokenScan.nextChar(JsonCompileImplV2.java:359)
at org.nutz.json.impl.JsonTokenScan._nextToken(JsonCompileImplV2.java:71)
at org.nutz.json.impl.JsonTokenScan.nextToken(JsonCompileImplV2.java:133)
at org.nutz.json.impl.JsonTokenScan.readMap(JsonCompileImplV2.java:176)
at org.nutz.json.impl.JsonTokenScan.readObject(JsonCompileImplV2.java:233)
at org.nutz.json.impl.JsonTokenScan.readMap(JsonCompileImplV2.java:188)
at org.nutz.json.impl.JsonTokenScan.read(JsonCompileImplV2.java:340)
at org.nutz.json.impl.JsonCompileImplV2.parse(JsonCompileImplV2.java:26)
at org.nutz.json.Json.fromJson(Json.java:42)
at org.nutz.mvc.adaptor.JsonAdaptor.getReferObject(JsonAdaptor.java:41)
at org.nutz.mvc.adaptor.AbstractAdaptor.adapt(AbstractAdaptor.java:226)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:28)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at com.cnaisin.common.mvc.LogTimeProcessor.process(LogTimeProcessor.java:30)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:198)
at com.cnaisin.common.mvc.MvcNutzFilter.doFilter(MvcNutzFilter.java:42)
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:108)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
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:620)
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:1110)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketTimeoutException
at org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector.java:201)
at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:235)
at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:216)
at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1212)
at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1163)
at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:742)
at org.apache.coyote.http11.Http11InputBuffer.access$400(Http11InputBuffer.java:38)
at org.apache.coyote.http11.Http11InputBuffer$SocketInputBuffer.doRead(Http11InputBuffer.java:1073)
at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:100)
at org.apache.coyote.http11.Http11InputBuffer.doRead(Http11InputBuffer.java:303)
at org.apache.coyote.Request.doRead(Request.java:511)
at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:318)
at org.apache.tomcat.util.buf.ByteChunk.checkEof(ByteChunk.java:397)
at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:379)
at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:338)
at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:189)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at java.io.PushbackInputStream.read(PushbackInputStream.java:186)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at sun.nio.cs.StreamDecoder.read0(StreamDecoder.java:127)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:112)
at java.io.InputStreamReader.read(InputStreamReader.java:168)
at org.nutz.json.impl.JsonTokenScan.readChar(JsonCompileImplV2.java:404)
... 46 more

1 回复

一般原因是数据库连接池不够用

添加回复
请先登陆
回到顶部