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

Session Persistence Scope
You can specify the scope of the persistence in addition to persistence frequency on the same
page in the Admin Console where you specify persistence frequency, Congurations >
cong-name > Availability Service (Web Container Availability).
For detailed description of dierent persistence scopes, see
Chapter 7, “Conguring High
Availability Session Persistence and Failover,” in Sun GlassFish Enterprise Server 2.1 High
Availability Administration Guide
.
Persistence scope can be one of:
■
session
■
modifed-session
■
modied-attribute
session
With the session persistence scope, the server writes the entire session data to
HADB—regardless of whether it has been modied. This mode ensures that the session data in
the backend store is always current, but it degrades performance, since all the session data is
persisted for every request.
modied-session
With the modied-session persistence scope, the server examines the state of the HTTP session.
If and only if the data has been modied, the server saves the session data to HADB. This mode
yields better performance than session mode, because calls to HADB to persist data occur only
when the session is modied.
modied-attribute
With the modied-attribute persistence scope, there are no cross-references for the attributes,
and the application uses setAttribute() and getAttribute() to manipulate HTTP session
data. Applications written this way can take advantage of this session scope behavior to obtain
better performance.
Session Size
It is critical to be aware of the impact of HTTP session size on performance. Performance has an
inverse relationship with the size of the session data that needs to be persisted. Session data is
stored in HADB in a serialized manner. There is an overhead in serializing the data and
inserting it as a BLOB and also deserializing it for retrieval.
Tests have shown that for a session size up to 24KB, performance remains unchanged. When
the session size exceeds 100KB, and the same back-end store is used for the same number of
connections, throughput drops by 90%.
Tuning the Enterprise Server for High-Availability
Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide • January 2009118










