On 21/10/2011 11:42, André Warnier wrote: > Allright, so how about a half-way house to start with ? > Keep the list in some thread-safe table, indexed by session-id, and just > scan the table. > Updating the corresponding session entry at each request should be cheap. > > Of course in all this, my basic assumption is that currently, Tomcat > keeps session information (including the expiration data) in some > location which requires an I/O action to access.
That assumption is incorrect. Which pretty much invalidates the rest of the points below. Again, I *strongly* encourage you to look at the current implementation before suggesting improvements. Mark > If so, an immediate benefit of having a table in memory, may be that > when a request comes in with a session-id, the check of whether this > session-id is still valid may be speeded up significantly (as opposed to > try to actually "get" the session info through an I/O and maybe > failing). And even if found in the table, the check on the expiration > time would be quick too. And if it is expired, deleting the entry from > the table, and deleting the session info through an I/O, may still be > faster than first retrieving the session info from disk. > > Re-thinking about the above, an easier way to achieve a similar effect, > may be to arrange to store all session info onto something like a > RAM-disk of course. > > Basically my feeling is this : assuming for example 1000 on-going > sessions, the background thread needs to do at least 1000 I/O's (and > probably many more) each time it checks for session expiration. And this > only to compare "now" with the session's expiration data. > Intuitively, this seems like a significant waste of I/O bandwidth, which > could be avoided at the cost of a bit of RAM. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org