The session size per request depends on the amount of session information stored in the session.
To improve overall performance, reduce the amount of information in the session as much as possible.
It is possible to fine-tune the session size per request through the persistence scope settings. Choose from the following options for HTTP session persistence scope:
session: The server serializes and saves the entire session object every time it saves session information to HADB.
modified-session: The server saves the session only if the session has been modified. It detects modification by intercepting calls to the bean’s setAttribute() method. This option will not detect direct modifications to inner objects, so in such cases the SFSB must be coded to call setAttribute() explicitly.
modified-attribute: The server saves only those attributes that have been modified (inserted, updated, or deleted) since the last time the session was stored. This has the same drawback as modified-session but can significantly reduce HADB write throughput requirements if properly applied.
To use this option, the application must:
Call setAttribute() or removeAttribute() every time it modifies session state.
Make sure there are no cross references between attributes.
Distribute the session state across multiple attributes, or at least between a read-only attribute and a modifiable attribute.
The following table summarizes the advantages and disadvantages of the persistence scope options.