Sun Java System Web Server 6.1 SP7 Programmer's Guide to Web Applications

MMapSessionManager (UNIX Only)

This is a persistent memory map (mmap) file-based session manager that works in both single-process and multi-process mode.

The MaxProcs directive in the magnus.conf file determines whether the server is running in single-process or multi-process mode. For more information, see the Sun Java System Web Server 6.1 SP7 NSAPI Programmer’s Guide.

Enabling MMapSessionManager

You may want to enable MMapSessionManager to change its default parameters. You can also enable MMapSessionManager for a particular context if the server is running in single-process mode. To do so, edit the sun-web.xml file for the web application as in the following example. Note that persistence-type must be set to mmap.

<sun-web-app>
        ...
        <session-config>
            <session-manager persistence-type=”mmap”>
              ...
          </session-manager>
           ...
        </session-config>
        ...
</sun-web-app>

For more information about the sun-web.xml file, see Chapter 7, Deploying Web Applications

Manager Properties for MMapSessionManager

The following table describes manager-properties properties for the MMapSessionManager session manager. The left column lists the property name, the middle column indicates the default value, and the right column describes what the property does.

Table 4–7 manager-properties Properties for MMapSessionManager

Property Name  

Default Value  

Description  

maxSessions

1000

The maximum number of sessions maintained by the session manager at any given time. The session manager refuses to create any more new sessions if there are already maxSessions number of sessions present at that time.

maxValuesPerSession

10

The maximum number of values or objects a session can hold. 

maxValueSize

4096

The maximum size of each value or object that can be stored in the session. 

timeOut

1800

The amount of time in seconds after a session is last accessed by the client before the session manager destroys it. Those sessions that haven’t been accessed for at least timeOut seconds are destroyed by the reaper method.

If session-timeout is specified in web.xml, it overrides this timeOut parameter value.

reapInterval

600

The amount of time in seconds that the SessionReaper thread sleeps before calling the reaper method again.

maxLocks

1

The number of cross-process locks to use for synchronizing access to individual sessions across processes. The default value is used if the value 0 is specified. This parameter is ignored in single-process mode.


Note –

The MMapSessionManager can only store objects that implement java.io.Serializable.