
EJB Performance Tuning
EJB Performance Tuning
The Enterprise Server’s
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 Specific Types of EJB Components” on page 42
■“JDBC and Database Access” on page 46
■“Tuning
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
■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
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.
32 | Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide • January 2009 |