You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2005/04/06 04:12:26 UTC

DO NOT REPLY [Bug 34319] New: - StoreBase.processExpires() is very inefficient

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34319>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34319

           Summary: StoreBase.processExpires() is very inefficient
           Product: Tomcat 5
           Version: 5.5.9
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: tom@squeat.com


Using a session store such as JDBCStore with the default configuration 
(Engine.backgroundProcessorDelay=10 and StandardManager.processExpiresFrequency=6), 
StoreBase.processExpires() will wake up once a minute and load all stored sessions into memory.   So, 
with the default 30-minute session-timeout setting, this means we are loading up to 29 minutes worth 
of sessions that won't be ready to expire.   In this example we load 30x more sessions than we actually 
need to. 

Since the purpose of StoreBase.processExpires() is to find sessions that are ready to be expired, it 
doesn't make sense to load ALL session for cases where we could pre-filter sessions BEFORE loading 
them.   For example, JDBCStore could use a where clause to reduce the number of sessions loaded as 
candidates to be expired and FileStore could query the filesystem for the age of the files before loading.    
The current behavior could be the worst-case fallback for Stores in which it is not possible to get age 
information.

I propose that StoreBase.processExpires() be refactored to load only keys of old sessions when possible 
by providing an oldKeys() method that may be overriden.   By default this would just return all keys but 
it should be easy to extend this in specialized versions (I will provide a sample patch to illustrate for 
JDBCStore).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org