Main | JVM Tuning of Web Services Manager (WSM) »

Performance Tuning of Java based Applications - OC4J

Recently I was involved in Performance, Scalablity & Reliablity (PSR) Testing of our metalink3 customer support portal. Since most of the technology components are based on Oracle's Application Server relying on OC4J what it came down to was how can we tune OC4J for best performance.

Metalink3 technical components I was involved in tuning were Secure Enterprise Search (SES) and Web Service Manager (WSM) .Both of products use OC4J which runs on Java.

Tuning is a excercise which has to be attacked patiently. I've been doing performance tuning for variety of Oracle products for a long time and one thing I learned is you have to figure out where the problem lies in order to solve it.

Here was the problem our PSR team was facing when i was brought in: After scaling to a particular number of concurrent users the application server would stop responding. They were trying to get to number of users much more than where they were crashing.

As part of the first exercise we enabled JConsole tool on the servers. This is critical to tuning, you ought to have tools to tell you what's going on in the system, otherwise its like shooting in the dark. Oracle has another tool Application diagnostic for java (AD4J) which we're setting to monitor JVM and java objects.

JConsole provides visual view of what's happening within your JVM and comes out of box with JDK 1.5. Important things we were looking for were GC times, threads, and individual Heap pools. After JConsole was set we then ran mini test runs with varying parameters. This showed us the problem shaping up in real-time.

JVM's GC and its memory parameters were tuned based on this info. Here you have to be careful as you have to understand the Operating system and Hardware you're working against,and you have to size parameters appropriately for your system.

After JVM we attacked OC4Js parameters like thread-pool ,http connection parameters, database pool andstatement caching. These were tuned for our needs as well.

Once we were done with final settings we let our PSR environment stress test the application for many hours. The JVMs were performing beautifully.

Here are some steps on how to do this kind of tuning on your OC4J or for that matter any Java based server like Weblogic, Tomcat etc.

a) Gather information on your environment
-Java parameter settings like -Xmx etc.
-OS level - ulimit, memory, OS, processor type, 32 vs 64 bit, shared memory segments, top ,vmstat etc.

b) Based on your analysis of above, determine the Max heap size of your system. Allocate that much memory and set -Xms == - Xmx.

c) Note that JVM 1.4.2 tuning is a lot different than JVM 5.0, consider the ergonomics aspects of JVM 5. Depending on your JVM choose best options.

d) Monitor for performance benefits. - JConsole, or JVMs printouts provide valuable inputs.

Here are some very useful links go get you started:


TrackBack

TrackBack URL for this entry:
http://blogs.oracle.com/mte1521/mt-tb.cgi/8368

Comments (1)

Perfect doc, hope to see more on JVM tuning.

Atul

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on November 5, 2008 2:39 PM.

The next post in this blog is JVM Tuning of Web Services Manager (WSM).

Many more can be found on the main index page or by looking through the archives.

Top Tags

Powered by
Movable Type and Oracle