Graham Leggett wrote:
A session is a simple table of key value pairs.
mod_session_dbd stores sessions within a SQL database. The session is tracked by a cookie, very similar to a typical Tomcat session. The catch is that you need a database beefy enough to handle the resulting load, which may or may not be a problem for the admin, they can decide.
Great idea. What would you think about converting from the session_save hook to a provider-based mechanism? I can imagine that administrators might want/need to use one kind of storage provider (dbd, say) for sessions on high-priority virtual hosts, while using another less reliable storage provider on others. Maybe this is possible with hooks if the storage modules return DECLINED unless they're the one that's most closely configured with a particular request. Still, it might be a little cleaner if the caller just looks up the appropriate provider and calls it directly. Again, great idea, thanks! Once more, with feeling, I'll plug the notion of a generic mod_shmap that implements shared map (key/value pair) storage, using any of various providers for each map: dbd, dbm, shared memory (w/ cyclic buffer), distcache, maybe memcached, etc. It would seem that mod_session would be an ideal potential customer for such a storage provider system, along with mod_proxy (for the stuff it shoehorns into the scoreboard now), mod_ssl, mod_auth_digest, and perhaps even the scoreboard itself. Administrators could set the storage provider for each individually. A default setup might use shmem for mod_proxy, distcache for mod_ssl and mod_auth_digest caches (would be nice to finally enable mod_auth_digest's shared cache code!), and dbd for user sessions. The trade-offs are the usual ones of performance vs. scalability/persistance/reliability. See http://marc.info/?l=apache-httpd-dev&m=120491055413781&w=2 for a proposed ap_shmap.h based on Joe Orton's refactoring of mod_ssl's session cache code. I can't be at the conference next week but I'd be willing to hack on either trunk, or perhaps better, a branch, per Paul Querna's suggestion. A way to start might be to take Joe Orton's latest dbm and shmem cyclic buffer providers and try to get mod_session + mod_shmap + {mod_shmap_dbm, mod_shmap_shmem} working as a proof of concept. Thoughts? Chris. -- GPG Key ID: 366A375B GPG Key Fingerprint: 485E 5041 17E1 E2BB C263 E4DE C8E3 FA36 366A 375B