[Solar-talk] Adapter-aware session package

Richard Thomas lists at cyberlot.net
Sun Nov 11 09:55:26 CST 2007


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.



On 11/11/07, Antti Holvikari <anttih at gmail.com> wrote:
> On 11/11/07, Paul M Jones <pmjones at solarphp.com> wrote:
> >
> > On 11 Nov 2007, at 06:49, Antti Holvikari wrote:
> >
> > > On 11/11/07, Ian Szewczyk <roamzero at gmail.com> wrote:
> > >> I wonder if a db adapter that uses sqlite would work better than one
> > >> that uses Solar_cache?
> > >
> > > I agree. I think I need to write DB and memcache adapters.
> >
> > I think the PHP memcache extension comes with a memcache session
> > handler, but I don't know how good it is or how useful it will be to
> > us here.
> >
> > <http://us.php.net/memcache>
> >      session.save_handler  (string)
> >      Use memcache as a session handler by setting this value to
> > "memcache".
>
> Interesting. That would be fast because there's no overhead because
> this is all in C level.
>
> --
> Antti Holvikari
> _______________________________________________
> Solar-talk mailing list
> Solar-talk at lists.solarphp.com
> http://mailman-mail3.webfaction.com/listinfo/solar-talk
>


More information about the Solar-talk mailing list