tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominik Stadler <dominik.stad...@dynatrace.com>
Subject PersistentManager with FileStore reports "persistentManager.swapInInvalid"
Date Wed, 06 Apr 2011 10:21:32 GMT
Hi,

We are using an embedded instance of Tomcat and would like to use a FileStore for Session
storage to keep memory requirements low while still allowing to have many sessions opened.
This is a single tomcat instance, sharing sessions with other instances is not needed.

As I embed Tomcat, I have created the FileStore as follows:

  Context context = tomcat.addWebapp(contextRoot, webDir);

        tomcat.start();

        { // Override the default Manager and set a persistent manager which can store Sessions
on disk
            PersistentManager manager = new PersistentManager();
              FileStore store = new FileStore();
              store.setDirectory(new File(workDir, "store").getAbsolutePath());
                  manager.setStore(store);
                  context.setManager(manager);
            manager.setMaxActiveSessions(-1);
            manager.setMaxIdleSwap(500);
            manager.setMinIdleSwap(200);
            manager.setMaxIdleBackup(400);
        }

As far as I understood documentation, this should allow me to have an unlimited number of
sessions (while the session timeout of 30 minutes still applies), but swaps out the sessions
at least after 500 seconds.

It basically works fine this way, only a limited number of sessions are held in memory, others
are swapped out. The only issue is that I start getting the following log output frequently
after aprox. half an hour when the first sessions are timing out:

2011-04-06 12:17:20 Custome SEVERE  [PersistentManagerBase] persistentManager.swapInInvalid
2011-04-06 12:17:20 Custome SEVERE  [PersistentManagerBase] persistentManager.swapInInvalid
2011-04-06 12:17:20 Custome SEVERE  [PersistentManagerBase] persistentManager.swapInInvalid
2011-04-06 12:17:21 Custome SEVERE  [PersistentManagerBase] persistentManager.swapInInvalid
2011-04-06 12:17:22 Custome SEVERE  [PersistentManagerBase] persistentManager.swapInInvalid
2011-04-06 12:17:22 Custome SEVERE  [PersistentManagerBase] persistentManager.swapInInvalid
2011-04-06 12:17:22 Custome SEVERE  [PersistentManagerBase] persistentManager.swapInInvalid
2011-04-06 12:17:22 Custome SEVERE  [PersistentManagerBase] persistentManager.swapInInvalid

When looking at the code in PersistentManager and StandardSession, I can not explain what
this severe-log tries to tell me. It seems we get this for every session that is timing out
after 30 minutes of inactivity. It seems the expiry-check marks the session as "invalid" which
in turn causes the check in swapIn() to fail.

Now my question:


-          As it seems to work nevertheless, can I safely ignore this error message or does
it indicate that I am doing something fundamentally wrong with PersistentManager and FileStore?


Thanks... Dominik

Dominik Stadler, Team Lead, R&D  dynaTrace<http://www.dynatrace.com/>, dominik.stadler@dynatrace.com<mailto:dominik.stadler@dynatrace.com>
 Skype: stadler.dominik
dynaTrace<http://www.dynatrace.com/> >> Monitor. Resolve. Prevent. >> www.dynatrace.com<http://www.dynatrace.com/>
| blog.dynatrace.com<http://blog.dynatrace.com/>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message