High CPU Utilization in Java/Tomcat based App Services Application running on Java 11.0.7

Anand R 1 Reputation point
2021-01-27T15:44:32.097+00:00

Hello,

We have a Java Web application running on Tomcat 9 in Azure App Services on a Windows App Services Plan. The App Service runtime is as follows :

Java - "D:\Program Files\Java\zulu11.39.15-jre11.0.7-win_x64\bin\java.exe"
Tomcat - "D:\Program Files\apache-tomcat-9.0.37"

We are experiencing a High CPU - close to 100% after one of our application logic runs to completion. After analyzing the profiling data recorded by the JDK Flight Recorder using the Zulu Mission Control utility, we narrowed down on the Java Thread that was contributing to the High CPU. The tread stack trace looks like the one you see below.

60980-highcpustacktrace.jpg

After doing some research, we landed on this stackoverflow post that indicates the cause of the problem.

https://stackoverflow.com/questions/54485755/java-11-httpclient-leads-to-endless-ssl-loop

Apparently, this issue has to do with a bug with TLS1.3 implementation in JDK11. This issue seems to be fixed in JDK11.0.8.

Now, my question is - Is there a way to configure the App Service app to use JRE11.0.8 instead of JRE11.0.7? I see that JRE11.0.8 installed on the server when I navigate to D:\Program Files\Java\ using the Kudu console -

01/16/2021 04:42 PM <DIR> zulu11.31.11-jre11.0.3-win_x64

01/16/2021 04:42 PM <DIR> zulu11.35.15-jre11.0.5-win_x64

01/16/2021 04:28 PM <DIR> zulu11.37.17-jre11.0.6-win_x64

01/16/2021 04:28 PM <DIR> zulu11.39.15-jre11.0.7-win_x64

01/16/2021 04:27 PM <DIR> zulu11.41.23-jre11.0.8-win_x64

Is there a way to switch to zulu11.41.23-jre11.0.8-win_x64?

Should I wait for Microsoft to update the Azure App Services? If so, how can I track as to when the upgrade is planned?

Is there a way to update the configuration file D:\Program Files\Java\zulu11.39.15-jre11.0.7-win_x64\conf\security\java.security as described in the stackoverflow post?

Thanks in advance for the support.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

2 answers

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2021-01-28T17:17:32.5+00:00

    Thanks for asking question! If I have understood right you are having Java Web application in Azure App Services on a Windows App Services Plan and facing High CPU issues.

    You may want to know that Azure App Service provides an intelligent and interactive experience to help you troubleshoot your app with no configuration required. When you do run into issues with your app, the diagnostics tool will point out what’s wrong to guide you to the right information to more easily and quickly troubleshoot and resolve the issue.

    To access App Service diagnostics, navigate to your App Service app in the Azure portal. In the left navigation, click on Diagnose and solve problems.

    61562-inkeddiagnose-tool-li.jpg

    You may refer to this detailed blog on deep dive on Diagnosing CPU utilization issues in Azure App Service built using any framework such as ASP.NET, Node, PHP, or Java running on a dedicated hardware tier (Basic or higher).

    Please let us know if you have any query on this or issue persists.


  2. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2021-01-29T07:57:38.807+00:00

    Thanks for reply! App Service allows users to choose the major version of the JVM, such as Java 8 or Java 11, as well as the minor version, such as 1.8.0_232 or 11.0.7. You can also choose to have the minor version automatically updated as new minor versions become available.

    61700-inkeddemo1.jpg

    Also, In most cases, production sites should use pinned minor JVM versions. This will prevent unnanticipated outages during a minor version auto-update. If you choose to pin the minor version, you will need to periodically update the JVM minor version on the site. To ensure that your application runs on the newer minor version, create a staging slot and increment the minor version on the staging site. Once you have confirmed the application runs correctly on the new minor version, you can swap the staging and production slots.

    You may refer to this latest Java, Tomcat, and JBoss EAP version updates

    Also check Java runtime statement of support might be helpful.

    Let us know if you have further query on this or issue remains.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.