Sun Microsystems 820434310 Server User Manual


 
EJB Performance Tuning
The Enterprise Server’s high-performance EJB container has numerous parameters that aect
performance. Individual EJB components also have parameters that aect performance. The
value of individual EJB component’sparameter overrides the value of the same parameter for
the EJB container. The default values are designed for a single-processor computer
system—change them to optimize for other system congurations.
This section covers the following topics:
“Goals” on page 32
“Monitoring EJB Components” on page 32
“General Guidelines” on page 35
“Using Local and Remote Interfaces” on page 36
“Improving Performance of EJB Transactions” on page 38
“Using Special Techniques” on page 39
“Tuning Tips for Specic Types of EJB Components” on page 42
“JDBC and Database Access” on page 46
“Tuning Message-Driven Beans” on page 47
Goals
The goals of EJB performance tuning are:
Increased speed - Cache as many beans in the EJB caches as possible to increase speed
(equivalently, decrease response time). Caching eliminates CPU-intensive operations.
However, since memory is nite, as the caches become larger, housekeeping for them
(including garbage collection) takes longer.
Decreased memory consumption - Beans in the pools or caches consume memory from
the Java virtual machine heap. Very large pools and caches degrade performance because
they require longer and more frequent garbage collection cycles.
Improved functional properties - Functional properties such as user time-out, commit
options, security, and transaction options, are mostly related to the functionality and
conguration of the application. Generally, they do not compromise functionality for
performance. In some cases, you might be forced to make a “trade-o” decision between
functionality and performance. This section oers suggestions in such cases.
Monitoring EJB Components
When the EJB container has monitoring enabled, you can examine statistics for individual
beans based on the bean pool and cache settings.
For example, the monitoring command below gives the Bean Cache statistics for a stateful
session bean.
EJB PerformanceTuning
SunGlassFishEnterpriseServer2.1PerformanceTuningGuide January200932