J2EE Performance Tuning

by Sandeep Desai (http://www.thedesai.net/sandeep)

 

Java Tuning

Java Memory Tuning

 

 

java ... -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:NewSize=1200m -XX:SurvivorRatio=16

 

The reasoning for each setting is as follows:

 

-XX:+DisableExplicitGC - some libs call System.gc(). This is usually a bad idea and could explain some of what we saw.

-XX:+UseConcMarkSweepGC - use the low pause collector

-XX:NewSize=1200m -XX:SurvivorRatio=16 - the black magic part. Tuning these requires emprical observation of your GC log, either from verbose gc or jstat ( a JDK 1.5 tool). In particular the 1200m new size is 1/4 of our heap size of 4800MB.

 

Oracle Database Tuning

 

J2EE optimization

 

Use Clustering (see J2EE Clustering article)

 

Servlet optimization

Metrics

 

Response time is end users experience of response, need to find out different response time, e.g some user may have 1-second response and some may have 10 second.

Resource utilization, measure utilization of contended resources

 

Throughput and response times at odd for an interactive application

 

Metric measurement add overhead

 

Measure client response time using, browser scripting or synthetic transactions (more popular). Make sure synthetic transactions are execute close to the client

 

No standard in metrics between OS, database, Web Servers,

 

JVM provides metrics using JMX

 

JMX

 

 

J2EE Servers metrics

 

Other approaches