Tomcat 8 speed gets degraded over time

别来无恙 提交于 2019-12-11 07:05:05

问题


I am using Tomcat 8.5 to host a WAR which is used for java REST services.

In my rest service, I create a connection and take a multi-part form data file from user, scan it using a scan engine and return the result. At the start, tomcat is running fine and giving a speed of almost 57-58 Mbps but degrades over time (degrades to nearly half in 5-8 min)

My setenv.bat file looks like this.

"set "JAVA_OPTS=%JAVA_OPTS% -Xms1024m -Xmx5120m -XX:MaxMetaspaceSize=512m -Xincgc -server""

JVM is using ParNewGC for garbage collection.

my server.xml file looks like this

<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--> 

As my response is completely dynamic. I am not using any type of caching. please help me with this issue.


回答1:


It may be a error due to a large number of open tcp/ip connections .Try connecting with server for once and send data check for sockets when you see a performance degradation.

In windows, you can use netstat-an to check the open sockets.



来源:https://stackoverflow.com/questions/52382950/tomcat-8-speed-gets-degraded-over-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!