Edward Chan wrote:
The default behavior of server-side session caching is
to cache session in memory. This is probably not
gonna work very well if there are a lot of connections
to the server....

It says to "open file named according to session id". However, session_id contains non-ascii chars, chars
that are illegal in a filename. So how can I name my
file according to the session_id?
If you have enough sessions that you need to cache them on disk, you probably don't want to write them one-to-a-file either. Don't be so literal about the "open file" comment.

Instead, open a single database instance (e.g., a Berkeley DB in "hash" mode, since you don't care about ordering) and use the session ID as your key ID. The non-ASCII characters aren't an issue since you specify a pointer and length, not a null-terminated string, as your key.

In practice, I believe apache's mod_ssl uses sdb instead of traditional db files for some reason, and you should definitely investigate why. But definitely go with a single, very efficient container object instead of using the filesystem as one. Even if you're guaranteed to be running on a new FS that uses btrees for the directory info, it's still much faster to do a hash lookup than a btree search, O(1) vs O(lg N).

Bear

______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]


Reply via email to