Code to store PHP sessions within memcached.

Kevin Burton burton at
Sat Nov 18 06:32:15 UTC 2006

On 11/17/06, Reinis Rozitis <roze at> wrote:
> Hmm why dont you just use the nice feature of php to have your own session
> handling functions override the default which could be transparent to the
> rest of the code?
> We use something like this:

Because I'm not a PHP god and we only have 3 .php files which need session
support :)

Tested on 30k concurent users/sessions online with 7 switching (roundrobin)
> www nodes and it works just fine..
> The conclusion we got its best to keep some seperate Memcached instance
> just
> for the sessions that way you dont mix it with other type of data caches
> and
> because of LRU push the needed items out.

Totally... you should absolutely use a separate MC instance.


Location: San Francisco, CA
AIM/YIM: sfburtonator
Skype: burtonator
Cell: 415-637-8078
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the memcached mailing list