Session settings
Session settings can be configured in a server or
environment file using NexJ Studio.
The following session settings can be configured in the
Clustering/Session subtab of the
Overview tab when editing a server or environment
file:
- Session Timeout
- The amount of time where an inactive session is considered to be timed out, in minutes. If Persistent Session is disabled, the session information on the server is lost when a timeout occurs. If Persistent Session is enabled, the session information is persisted when a timeout occurs. A value of 0 represents unlimited time, where session information is stored in the server until it is shut down, and no information is persisted. The Session Timeout property overrides any session timeout settings configured on the application server side.
- Persistent Session
- Enables session persistence. Session information is stored using a file system or a database.
- Compressed Persisted Session State
- Enables compression of the persisted session state to reduce storage size by approximately five times, at the cost of increased CPU overhead.
- Persistence Directory
- Shared directory for storing the persisted session state. If using a clustered server, you must configure the directory to be accessible by all nodes. If the directory is left empty, sessions are persisted to the session database. To store sessions in the Session table, you must add a data source connection for the SessionDatabase data source to the connection or environment file and create the SessionDatabase table with the Data Load Tool or the Database Schema Tool.
- Persistence Directory Depth
- If the Persistence Directory is specified, the session ID is placed into a number of subdirectories. Each subdirectory is named after 2 characters of the session ID, starting from the beginning of the ID. For example, a session ID of 18106FCFA235DA286CF27401AD0BCFBB and a depth setting of 2 would store the session ID in the following directory: \PersistenceDirectory\18\10.
Session load balancing alogithm
You can also
specify the session load balancing algorithm to use when restoring
sessions from the persistence store. There are three possible values:
- preemptive
- Default. Indicates that session load balancing is always done when a session is restored from the persistence store.
- threshold
- Indicates that session load balancing should only occur if the current node is busy, that is, the memory-in-use is above the threshold or CPU is above the threshold.
- none
- Indicates that no load balancing should be done and the “best” node should be the current node. Request redirection may still occur if an external load balancer redirects a request to another node.
If you want to specify a load balancing algorithm other than
preemptive, you need to add the balancing attribute
when editing the server or environment file. Add the
balancing attribute to the
Environment or Server element, using
the Source tab in the editor. For example, enter
balancing="none"
to indicate that no balancing should be
done.
Warning: Incorrect values will result in a warning
message in the system log and the default algorithm preemptive will be
used.
The load balancing algorithm controls when the request will be considered for redirection. If the current node happens to be the best available node, then the request will not necessarily be redirected to another node.
Note: To specify the load balancing algorithm at the
model level, edit the balancing property in the
System.SessionManager.com component. This value will
be overridden by the value specified in the environment or server
file.