IBM Support

Performance Issues With WebSphere V8.5

Troubleshooting


Problem

A Spring Application calling ApplicationContext.getBean() on a prototype bean using the @Async annotation caused an increase in Spring method calls. This increase in Spring method calls resulted in higher CPU usage when moving to WebSphere V8.0 and above.

Symptom

Higher CPU usage by applications calling Spring's ApplicationContext.getBean() with @Async annotation when moving to WebSphere V8.0 and above.

Cause

WebSphere V8 and above contain interface classes for the EJB 3.1 specification level which includes the support for using the @Asynchronous annotation. Prior to WebSphere V8.0 Spring was only searching for the @Async annotation. At WebSphere V8.0 and above Spring was searching for both @Async and @Asynchronous annotations. The additional searching for the added support for @Asynchronous was the cause of the higher CPU.
The problem was reported with an application using Spring 3.0.7

Environment

Applications running in WebSphere Application Server V8.0 or above, that use Spring framework.

Diagnosing The Problem

High CPU usage problems can be difficult to diagnose, and there can be several diagnostic techniques used to determine what is using more CPU.

The diagnostic steps that were taken for this problem were:

  1. WebSphere Application Server V7.x and V8.x were available for testing
  2. The same application code was used on both WebSphere Application Servers.
  3. The same application request was driven on both WebSphere Application Servers
  4. A java entry and exit trace at the package level was enabled to identify the package and class where the number of method calls increased. e.g. -Xtrace:methods={com/appcode/*,org/springframework/*}
  5. Iteratively drilled down, into the higher used package names, to determine which java classes were being driven more in the WebSphere V8 Application Server versus the WebSphere V7 Application Server. This was accomplished by using an editor to compare the counts of the package, class, and method names from WebSphere Application Server V7 vs. V8

Resolving The Problem

The solutions listed below may not be applicable to all situations, but the solutions are provided below to assist resolving similar symptoms.
The solutions were:

  • Change the logic to Cache the bean instance returned from ApplicationContext.getBean() call.
  • Remove annotation-driven @Async searches by Spring. This was accomplished by removing the configuration option "task:annotation-driven"

[{"Product":{"code":"SS7K4U","label":"WebSphere Application Server for z\/OS"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Hangs\/Performance Degradation","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"8.5.5;8.5;8.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21648523