Geoff Thorpe wrote: > The hash-database means the only way to
Or you maintain an auxillary database that maps the expiry time to a list of session IDs. This could be a btree (perhaps with a bucket of session IDs, to avoid dulicate keys) or a priority queue, or a number of other things.remove expired sessions is to iterate across the entire database!
Since this is a much smaller structure, it could be maintained in memory. If you restart the system you'll have to rebuild the auxillary database, but it should only take O(N lg N) time.
I agree that you could also use directories. My concern is just that I've seen applications crawl because of the time required to scan a directory when there's more than a few hundred entries in it. If you use directories to keep the entry count down, you can minimize this problem.
Bear
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]
