Sun Java System Application Server Enterprise Edition 8.2 Performance Tuning Guide

General Guidelines

The following guidelines can improve performance of EJB components. Keep in mind that decomposing an application into many EJB components creates overhead and can degrade performance. EJB components are not simply Java objects. They are components with semantics for remote call interfaces, security, and transactions, as well as properties and methods.

Use High Performance Beans

Use high-performance beans as much as possible to improve the overall performance of your application. For more information, see Tuning Tips for Specific Types of EJB Components

The types of EJB components are listed below, from the highest performance to the lowest:

  1. Stateless Session Beans and Message Driven Beans

  2. Stateful Session Beans

  3. Container Managed Persistence (CMP) entity beans configured as read-only

  4. Bean Managed Persistence (BMP) entity beans configured as read-only

  5. CMP beans

  6. BMP beans

Use Caching

Caching can greatly improve performance when used wisely. For example:

Use the Appropriate Stubs

The stub classes needed by EJB applications are generated dynamically at runtime when an EJB client needs them. This means that it is not necessary to generate the stubs or retrieve the client JAR file when deploying an application with remote EJB components. When deploying an application, it is no longer necessary to specify the --retrieve option, which can speed up deployment.

If you have a legacy rich-client application that directly uses the CosNaming service (not a recommended configuration), then you must generate the stubs for your application explicitly using RMIC. For more information, see Sun Java System Application Server Enterprise Edition 8.2 Troubleshooting Guidefor more details.

Remove Unneeded Stateful Session Beans

Removing unneeded stateful session beans avoids passivating them, which requires disk operations.

Cache and Pool Tuning Tips

Follow these tips when using the EJB cache and pools to improve performance: