Sun Microsystems 820434310 Server User Manual


 
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 Congurations > cong-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 specied 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
“Conguring 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
Congurations > cong-name > Web Container (Manager Properties), where cong-name is
the name of the conguration. 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.
TuningtheEnterprise ServerforHigh-Availability
Chapter6 • TuningforHigh-Availability 117