OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.15k stars 587 forks source link

High CPU Usage with docker image of open liberty 20.0.x #18479

Open mrinalkumari06 opened 3 years ago

mrinalkumari06 commented 3 years ago

We are deploying docker image for open liberty 20.0.x on Azure cloud and on AKS cluster and seeing high usage of Application Server CPU during performance run.

We have tried with all below base images:

Also did added in server.xml some performance parameters by referring below link: https://www.ibm.com/docs/en/was-liberty/zos?topic=tuning-liberty

<connectionManager minPoolSize="20" maxPoolSize="300" maxIdleTime="90s" purgePolicy="FailingConnectionOnly" maxConnectionsPerThread="20" numConnectionsPerThreadLocal="10"/>

Tried also setting JAVA_OPTS:

JAVA_OPTS: “ -Xloggc:verbosegc.txt -XX:AdaptiveSizePolicyWeight=90 -XX:CICompilerCount=2 -XX:+ExitOnOutOfMemoryError -XX:GCTimeRatio=4 -XX:MaxHeapFreeRatio=20 -XX:MinHeapFreeRatio=10 -XX:ParallelGCThreads=8 -XX:+UseParallelOldGC -XX:CompressedClassSpaceSize=528482304 -XX:InitialHeapSize=2147483648 -XX:MaxHeapSize=5368709120 -XX:MaxMetaspaceSize=536870912 -XX:+PrintGC -XX:+PrintGCTimeStamps -XX:+UseCompressedClassPointers -XX:+UseCompressedOops ”

But still seeing high spikes in CPU server utilization. Can someone provide some help on this? What other approach we should try?

gjdeval commented 3 years ago

A couple of preliminary comments:

Now to the particular issue raised - "high spikes in CPU server utilization". A few basic questions, to get some context

There are many possible causes of high cpu. For example, if the java heap becomes over-full, then garbage collection may become very active, and since GC is generally multi-threaded, this may cause high cpu. Among the JVM args listed is one that will cause a GC log to be generated. Have you examined that log to check the heap condition? If the GC log shows that the heap is very full, increasing the heap size may reduce the cpu spikes.

If the GC log does not clarify the cause of high cpu, then a more fundamental analysis of the system may be necessary. The WebSphere Performance Cookbook provides comprehensive guidance for investigating and resolving performance problems commonly encountered in application server deployments. https://publib.boulder.ibm.com/httpserv/cookbook/cookbook.html

If you are a member of an organization that has a support agreement with IBM for Open Liberty, you can request help by opening a trouble ticket. In that case, you will probably be asked to collect a set of data from your system while the problem is occurring. https://www.ibm.com/support/pages/node/1073532

I hope this information is helpful.

Regards, Gary