[Tickets #2781] NEW: Enhancements for memcache session driver

bugs@bugs.horde.org bugs at bugs.horde.org
Thu Oct 13 20:04:18 PDT 2005


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=2781
-----------------------------------------------------------------------
 Ticket             | 2781
 Created By         | kevin_myer at iu13.org
 Summary            | Enhancements for memcache session driver
 Queue              | Horde Framework Packages
 Version            | HEAD
 State              | New
 Priority           | 1. Low
 Type               | Enhancement
 Owners             | 
+New Attachment     | memcached.php.patch
-----------------------------------------------------------------------


kevin_myer at iu13.org (2005-10-13 20:04) wrote:

This is a first crack at adding some enhancements and robustness to the
memcache driver.

Enhancements:
Support for persistent connections
($conf['sessionhandler']['params']['persistent']
Support for compression ($conf['sessionhandler']['params']['compression']
Support for multiple servers, comma separated 'hostspec' and 'port' values
(is there a cleaner way to do this??)

Sessions are hashed to determine what server they should be stored on and
all read/write/delete functions are passed through this function to get the
proper connection.

The ideas for this are synthesized from the various generic and
session-specific memcache implementations in APIs I've found.  The hash
function to determine the server to write the session to is supposed to
distribute the values the most evenly and be the higher performance function
for those available.

TODO:
Test extensively (works for me, with one bogus server in my config,
representing a down server, and one real server, but the usual no warranty
implied, don't use in healthcare settings, etc. applies)
Add support for down server detection, with a timer to repoll down servers
to see if they've come back.  $_connected should probably be an array which
maintains up/down state for each potential connection.
Add support for session enumeration (with memcached, 'stats items' yields a
list of the buckets, 'stats cachedump bucket#' would yield the sessionid,
both of  which I think can be mapped to PHP memcache stat functions, or a
stat function can be written that returns a list of sessionids)
Add a prefix to the sessionid so multiple sites sessions can be stored in
the same set of memcached servers, but can be enumerated by each separate
site
Better error handling and logging




More information about the bugs mailing list