我使用Tomcat8.5托管一个用于java服务的WAR。
在rest服务中,我创建一个连接并从用户那里获取一个多部分表单数据文件,使用扫描引擎扫描它并返回结果。一开始,tomcat运行良好,速度接近57-58 Mbps,但随着时间的推移而下降( 5-8分钟内下降到近一半)。
我的setenv.bat文件看起来像这样。
"set "JAVA_OPTS=%JAVA_OPTS% -Xms1024m -Xmx5120m -XX:MaxMetaspaceSize=512m -Xincgc -server""JVM正在使用ParNewGC进行垃圾收集。
我的server.xml文件如下所示
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="100" minSpareThreads="8" maxSpareThreads="10" acceptorThreadCount="16" acceptCount="500"/>
<!--acceptCount :The maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is full will be refused. The default value is 100.
A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
-->
<Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" socket.rxBufSize="10000000" socket.txBufSize="3000000" socket.directBuffer="true" />
<!-- A "Connector" using the shared thread pool--> 因为我的反应是完全动态的。我是,不使用任何类型的缓存。请帮我解决这个问题。
发布于 2018-09-25 05:49:48
这可能是由于大量打开的tcp/ip连接、 .Try与服务器连接一次,并在您看到性能下降时发送套接字数据检查而导致的错误。
在windows中,可以使用netstat-an检查打开的套接字。
https://stackoverflow.com/questions/52382950
复制相似问题