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

Max Cache Size Maximum number of beans in the cache. Make this setting greater than one. The default value is 512. A
value of zero indicates the cache is unbounded, which means the size of the cache is governed by Cache
Idle Timeout and Cache Resize Quantity. The corresponding EJB deployment descriptor attribute is
max-cache-size.
Cache Resize
Quantity
Number of beans to be created or deleted when the cache is serviced by the server. Valid values are from
zero to MAX_INTEGER, and the default is 16. The corresponding EJB deployment descriptor attribute is
resize-quantity.
Removal Timeout Amount of time that a stateful session bean remains passivated (idle in the backup store). If a bean was not
accessed after this interval of time, then it is removed from the backup store and will not be accessible to
the client. The default value is 60 minutes. The corresponding EJB deployment descriptor attribute is
removal-timeout-in-seconds.
Removal Selection
Policy
Algorithm used to remove objects from the cache. The corresponding EJB deployment descriptor
attribute is victim-selection-policy.Choices are:
■
NRU (not recently used). This is the default, and is actually pseudo-random selection policy.
■
FIFO (rst in, rst out)
■
LRU (least recently used)
Cache Idle
Timeout
Maximum time that a stateful session bean or entity bean is allowed to be idle in the cache. After this time,
the bean is passivated to the backup store. The default value is 600 seconds. The corresponding EJB
deployment descriptor attribute is cache-idle-timeout-in-seconds.
Refresh period Rate at which a read-only-bean is refreshed from the data source. Zero (0) means that the bean is never
refreshed. The default is 600 seconds. The corresponding EJB deployment descriptor attribute is
refresh-period-in-seconds. Note: this setting does not have a custom eld in the Admin Console. To
set it, use the Add Property button in the Additional Properties section.
Pool and Cache Settings for Individual EJB Components
Individual EJB pool and cache settings in the sun-ejb-jar.xml deployment descriptor override
those of the EJB container. The following table lists the cache and pool settings for each type of
EJB component.
TABLE 3–2 EJB Cache and Pool Settings
Cache Settings Pool Settings
Type of
Bean
cache-
resize-
quantity
max- cache-
size
cache-
idle-
timeout-
in-
seconds
removal-
timeout- in-
seconds
victim-
selection-
policy
refresh-
period-
in-
seconds
steady-
pool-size
pool-
resize-
quantity
max-
pool-
size
pool-idle-
timeout-in-
seconds
Stateful
Session
XXXXX
Stateless
Session
XXXX
Max Cache Size
Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide • January 200956










