Tuning HADB
Calculating the number of locks
To calculate the number of locks needed, estimate the following parameters:
■Number of concurrent users that request session data to be stored in HADB (one session record per user)
■Maximum size of the BLOB session
■Persistence scope (max session data size in case of session/modified session and maximum number of attributes in case of modified session). This requires setAttribute() to be called every time the session data is modified.
If:
■x is the maximum number of concurrent users, that is, x session data records are present in the HADB, and
■y is the session size (for session/modified session) or attribute size (for modified attribute), Then the number of records written to HADB is:
xy/7000 + 2x
Record operations such as insert, delete, update and read will use one lock per record.
Note – Locks are held for both primary records and
Summary
If refragmentation is performed, the number of locks to be configured is:
Nlocks = 4x (y/7000 + 2) = 2xy/3500 + 2x
Otherwise, the number of locks to be configured is:
Nlocks = 2x (y/7000 + 2) = xy/3500 + 4x
Tuning NumberOfLocks
Start with the default value. Look for exceptions with the indicated error codes in the Enterprise Server log files. Remember that under normal operations (no ongoing refragmentation) only half of the locks might be acquired by the client application.
To get information on allocated locks and locks in use, use the following command:
hadbm resourceinfo
114 | Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide • January 2009 |