Sun Microsystems 820434310 manual EJB Performance Tuning, Goals, Monitoring EJB Components

Models: 820434310

1 128
Download 128 pages 34.03 Kb
Page 32
Image 32
EJB Performance Tuning

EJB Performance Tuning

EJB Performance Tuning

The Enterprise Server’s high-performance EJB container has numerous parameters that affect performance. Individual EJB components also have parameters that affect performance. The value of individual EJB component’s parameter 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 configurations.

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 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 finite, 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 configuration of the application. Generally, they do not compromise functionality for performance. In some cases, you might be forced to make a “trade-off” decision between functionality and performance. This section offers 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.

32

Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide • January 2009

Page 32
Image 32
Sun Microsystems 820434310 manual EJB Performance Tuning, Goals, Monitoring EJB Components, “General Guidelines” on page