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

Tuning Session Persistence Frequency
The Enterprise Server provides HTTP session persistence and failover by writing session data to
HADB. You can control the frequency at which the server writes to HADB by specifying the
persistence frequency.
Specify the persistence frequency in the Admin Console under Congurations > cong-name >
Availability Service (Web Container Availability).
Persistence frequency can be set to:
■
web-method
■
time-based
All else being equal, time-based persistence frequency provides better performance but less
availability than web-method persistence frequency. This is because the session state is written
to the persistent store (HADB) at the time interval specied by the reap interval (default is 60
seconds). If the server instance fails within that interval, the session state will lose any updates
since the last time the session information was written to HADB.
Web-method
With web-method persistence frequency, the server writes the HTTP session state to HADB
before it responds to each client request. This can have an impact on response time that
depends on the size of the data being persisted. Use this mode of persistence frequency for
applications where availability is critical and some performance degradation is acceptable.
For more information on web-method persistence frequency, see
“Conguring Availability for
the Web Container” in Sun GlassFish Enterprise Server 2.1 High Availability Administration
Guide
.
Time-based
With time-based persistence frequency, the server stores session information to the persistence
store at a constant interval, called the reap interval. You specify the reap interval under
Congurations > cong-name > Web Container (Manager Properties), where cong-name is
the name of the conguration. By default, the reap interval is 60 seconds. Every time the reap
interval elapses, a special thread “wakes up,” iterates over all the sessions in memory, and saves
the session data.
In general, time-based persistence frequency will yield better performance than web-method,
since the server’s responses to clients are not held back by saving session information to the
HADB. Use this mode of persistence frequency when performance is more important than
availability.
Tuning the Enterprise Server for High-Availability
Chapter 6 • Tuning for High-Availability 117










