Spring application high CPU utilization on tomcat server

Viewed 617

We have a Java application built on Spring. We are running this on a server with following configurations.

Total RAM : 32GB

No. of CPU : 8 cores ( Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz)

For Database we are using AWS MySQL aurora.

We are deploying our application war on tomcat 8 server with the following server.xml configuration and setenv.sh configuration.

server.xml

<Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="1000" minSpareThreads="20" maxIdleTime="60000" />

<Connector executor="tomcatThreadPool"
  port="8080" protocol="HTTP/1.1"
  connectionTimeout="60000"
  keepAliveTimeout="15000"
  maxKeepAliveRequests="1"
  redirectPort="8443" />

<Connector port="8443" protocol="HTTP/1.1"
            connectionTimeout="3000000"
            SSLEnabled="true"
            sslEnabledProtocols="TLSv1.2"
            scheme="https"
            compression="on"
            secure="true"
            compressionMinSize="1024"
            noCompressionUserAgents="gozilla, traviata" useSendfile="false"
            compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,text/css,img/png"/>

setenv.sh

export CATALINA_OPTS="$CATALINA_OPTS -Xms2048m"
export CATALINA_OPTS="$CATALINA_OPTS -Xmx6144m"
export CATALINA_OPTS="$CATALINA_OPTS -Xss512k"
export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=512m"
export CATALINA_OPTS="$CATALINA_OPTS -XX:+UseParallelGC"
export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxGCPauseMillis=1500"
export CATALINA_OPTS="$CATALINA_OPTS -XX:GCTimeRatio=9"
export CATALINA_OPTS="$CATALINA_OPTS -server"
export CATALINA_OPTS="$CATALINA_OPTS -XX:+DisableExplicitGC"

With the above configuration when we are performing the load test for around 40 users CPU utilization is shooting to more than 90%, and then the server becomes irresponsive.

I am pretty new to performance tuning and also don't have much expertise in tomcat. Can anyone please help me understand this?

Thanks!

1 Answers
Related