1

I'm experimenting with tomcat JDBCStore-based session persistence and wonder whether there is a way to make tomcat store sessions in DB as soon as possible?

I've tried to play with minIdleSwap and maxIdleSwap values, but I guess I just don't understand what actually those parameters are standing for, though I've read the documentation.

shabunc
  • 87
  • 1
  • 2
  • 12

1 Answers1

1

I think you need the maxIdleBackup setting. From the linked javadoc:

Sets the option to back sessions up to the Store after they are used in a request. Sessions remain available in memory after being backed up, so they are not passivated as they are when swapped out. The value set indicates how old a session may get (since its last use) before it must be backed up: -1 means sessions are not backed up.

Note that this is not a hard limit: sessions are checked against this age limit periodically according to processExpiresFrequency. This value should be considered to indicate when a session is ripe for backing up.

So it is possible that a session may be idle for maxIdleBackup + processExpiresFrequency * engine.backgroundProcessorDelay seconds, plus the time it takes to handle other session expiration, swapping, etc. tasks.

palacsint
  • 487
  • 4
  • 10