Server User Manual
Table Of Contents
- Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide
- Preface
- Overview of Enterprise Server Performance Tuning
- Tuning Your Application
- Java Programming Guidelines
- Java Server Page and Servlet Tuning
- EJB Performance Tuning
- Goals
- Monitoring EJB Components
- General Guidelines
- Using Local and Remote Interfaces
- Improving Performance of EJB Transactions
- Use Container-Managed Transactions
- Don’t Encompass User Input Time
- Identify Non-Transactional Methods
- Use TX_REQUIRED for Long Transaction Chains
- Use Lowest Cost Database Locking
- Use XA-Capable Data Sources Only When Needed
- Configure JDBC Resources as One-Phase Commit Resources
- Use the Least Expensive Transaction Attribute
- Using Special Techniques
- Tuning Tips for Specific Types of EJB Components
- JDBC and Database Access
- Tuning Message-Driven Beans
- Tuning the Enterprise Server
- Deployment Settings
- Logger Settings
- Web Container Settings
- EJB Container Settings
- Java Message Service Settings
- Transaction Service Settings
- HTTP Service Settings
- ORB Settings
- Thread Pool Settings
- Resources
- Tuning the Java Runtime System
- Tuning the Operating System and Platform
- Tuning for High-Availability
- Index

collection is happening too frequently, and the pool size is growing, but the cache hit rate is
small, then the pool-idle-timeout-in-seconds can be reduced to destroy the instances.
Note – Specifying a max-pool-size of zero (0) means that the pool is unbounded. The pooled
beans remain in memory unless they are removed by specifying a small interval for
pool-idle-timeout-in-seconds. For production systems, specifying the pool as unbounded is
NOT recommended.
Monitoring Individual EJB Components
To gather method invocation statistics for all methods in a bean, use this command:
asadmin get -m monitorableObject.*
where monitorableObject is a fully-qualied identier from the hierarchy of objects that can be
monitored, shown below.
serverInstance.application.applicationName.ejb-module.moduleName
where moduleName is x_jar for module x.jar.
■
.stateless-session-bean.beanName
.bean-pool
.bean-method.methodName
■
.stateful-session-bean.beanName
.bean-cache
.bean-method.methodName
■
.entity-bean.beanName
.bean-cache
.bean-pool
.bean-method.methodName
■
.message-driven-bean.beanName
.bean-pool
.bean-method.methodName (methodName = onMessage)
For standalone beans, use this pattern:
serverInstance.application.applicationName.standalone-ejb-module.moduleName
The possible identiers are the same as for ejb-module.
For example, to get statistics for a method in an entity bean, use this command:
asadmin get -m serverInstance.application.appName.ejb-module.moduleName
.entity-bean.beanName.bean-method.methodName.*
EJB PerformanceTuning
Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide • January 200934










