Configuring the Web Application’s Session Settings

If you have relatively short sessions, try decreasing the session
timeout by configuring the value of the timeOutSeconds property
under the session-properties element in sun-web.xml from the default value
of 10 minutes.

If you have relatively long sessions, you can try decreasing
the frequency at which the session reaper runs by increasing the value of
the reapIntervalSeconds property from the default value of once every minute.

In multi-process mode when the persistence-type in sun-web.xml is
configured to mmap, the session
manager uses cross-process locks to ensure session data integrity. These can
be configured to improve performance as described below.

Note –

For Java technology-enabled servers, multi-process mode is deprecated
and included for backward-compatibility only.

Tuning maxLocks (UNIX/Linux)

The implication of the number specified in the maxLocks property
can be gauged by dividing the value of maxSessions with maxLocks.
For example, if maxSessions = 1000 and you set maxLocks
= 10, then approximately 100 sessions (1000/10) contend for the
same lock. Increasing maxLocks reduces the number of sessions
that contend for the same lock and might improve performance and reduce latency.
However, increasing the number of locks also increases the number of open
file descriptors, and reduces the number of available descriptors that would
otherwise be assigned to incoming connection requests.

This example creates a memory mapped file of size 1000 X 10 X 4096 bytes, or ~40 MB.
As this is a memory mapped file, the process size will increase by 40 MB upon
startup. The larger the values you set for these parameters, the greater the
increase in process size.