[Solar-talk] Adapter-aware session package

Richard Thomas lists at cyberlot.net
Sun Nov 11 11:18:39 CST 2007


Hashing can work with either memcache or DB, in the end its all just a
set of data after its pulled out of the proper layer.

On 11/11/07, Paul M Jones <pmjones at solarphp.com> wrote:
>
> On 11 Nov 2007, at 09:55, Richard Thomas wrote:
>
> > User space session handlers tend to be slower for a couple reasons
> >
> > 1. Most people don't take into account session data doesn't change
> > every page load, 99% of all user land session handlers I have seen
> > read and write every single page load
> >
> > 2. If you don't store your data serialized you have to unserialize the
> > data input and serialize the data output to conform with the built in
> > session handler which adds extra overhead.
> >
> > 2 can't really be resolved without rewriting the whole ext/session,
> > but 1 can be dealt with by hashing the data on read and only writing
> > when the data has changed.
> >
> > You can also take that one step further, When you read check memcache
> > first, if not in memcache then pull from file/db.. When you do need to
> > write reset memcache.
> >
> > Using the above methods you can get your session data to the point
> > where its always reading from memcache, only writing when data
> > changes.
>
> At which point it seems, you might as well be only working with
> memcache, and no file or DB intercessory layer.  The hashing you
> suggest is equally applicable to a memcache-only technique.
>
>
> -- pmj
>


More information about the Solar-talk mailing list