response to your post on LJ re zeroconf-based formation/management feature...

Justin Matlock
Thu, 9 Oct 2003 11:03:10 -0400

Referring to:

I didn't want to clutter up your LJ with technobabble.  :)

Ryan, jump in and correct me if I miss something..

This sounds like a great idea, from a very high level.  But I can't think of
a way to make this work with the PHP API, simply because it's completely
stateless. There's not really any easy platform independent way to store
data from one PHP script to the next, much less between different PHP
processes running under different Apache threads.  I guess shared memory
would work, but... I see some issues there, as well (Windows doesn't have
shared memory, being one).

It would suck to have to 'rediscover' all of the memcached servers every
time a script starts up.

One way this could happen is maybe have a "master" memcached server, that
used multicast to find other memcached servers.  Have the clients contact
that master server at script start up, get the list, and use it to spread
the load.... but that's still a network call.   Or, use shared memory on the
web server, and have it 'expire' every 10 minutes... when that 10 minutes is
up, it just fetches a new list from a master server?  Or, simply have
memcached write a temporary file (actually a script) that is just included
with every script (this, of course, opens up all sorts of scary security
implications -- I know I wouldn't want my sites creating 'scripts on the
fly', especially since my webservers are AFS mounted read only).

I dunno... it's just something to keep in mind... I don't know how mod_perl
is -- but PHP is completely stateless... when a script ends, any
variables/etc are gone.


----- Original Message ----- 
From: "Brad Fitzpatrick" <>
To: <>
Sent: Thursday, October 09, 2003 7:13 AM
Subject: memcached 1.1.9

> New version!
> I didn't realize it'd been so long.  Somebody slap me next time there's
> too much good stuff in CVS.
> Thanks for everybody's contributions.  It's all the little things that
> make a polished, useable product.
> - Brad
> Changelog:
> 2003-10-09
>         * BSD compile fixes from Ryan T. Dean
>         * version 1.1.9
> 2003-09-29
>         * ignore SIGPIPE at start instead of crashing in rare cases it
>           comes up.  no other code had to be modified, since everything
>           else is already dead-connection-aware.  (avva)
> 2003-09-09 (Avva, Lisa Marie Seelye <>)
>         * setuid support
> 2003-09-05 (Avva)
>         * accept all new connections in the same event (so we work with ET
>         * mark all items as clsid=0 after slab page reassignment to please
>           asserts (on the road to making slab page reassignment work
> 2003-08-12 (Brad Fitzpatrick)
>         * use TCP_CORK on Linux or TCP_PUSH on BSD
>         * only use TCP_NODELAY when we don't have alternatives
> 2003-08-10
>         * disable Nagel's Algorithm (TCP_NODELAY) for better performance
> 2003-08-10
>         * support multiple levels of verbosity (-vv)
> 2003-08-10  (Evan Martin)
>         * debug, optimization, and static flags are
>           by the configure script.
>         *
>           - allow specifying libevent directory with --with-libevent=DIR
>           - check for malloc.h (unavailable on BSDs)
>           - check for socklen_t (unavailable on OSX)
>         * assoc.c, items.c, slabs.c:  Remove some unused headers.
>         * memcached.c:  allow for nonexistence of malloc.h; #define a
>           macro to import mlockall flags.