Re: cvs: pecl /memcache memcache.c php_memcache.h
| From: | Anatoly Vorobey | Date: | Mon, 01 Mar 2004 11:06:17 +0000 |
| Subject: | Re: cvs: pecl /memcache memcache.c php_memcache.h | ||
| References: | 1 2 3 4 5 | Groups: | php.pecl.cvs |
| Request: | Send a blank email to pecl-cvs+get-995@lists.php.net to get a copy of this message | ||
You wrote on Mon, Mar 01, 2004 at 11:52:02AM +0300:
> On Mon, 1 Mar 2004 00:41:06 -0800 (Pacific Standard Time)
> Rasmus Lerdorf <rasmus@php.net> wrote:
> > > > Is there no unix domain socket support in memcached?
> > >
> > > No, there is no such feature.
> > > Author says, that memcached supposed to be installed on dedicated server to get the
> > > maximum of performance.
> >
> > Uh, doesn't this contradict this quote from
> > http://www.danga.com/memcached/ ?
> >
> > The memcached server and clients work together to implement one global
> > cache across as many machines as you have. In fact, it's recommended you
> > run both web nodes (which are typically memory-lite and CPU-hungry) and
> > memcached processes (which are memory-hungry and CPU-lite) on the same
> > machines. This way you'll save network ports.
> >
> > By web nodes, I assume they mean web servers who are the memcached clients
> > in this case.
This quote is addressed primarily to administrators of large
installations, with many web servers (which are indeed memcached
clients) and memcached servers. LiveJournal, for which memcached was
originally developed, is one such installation. In such a scenario, each
memcached client talks to all memcached servers; the clients all use
the same hashing algorithm on the client side to decide on which
particular server a particular key should be stored (and requested
from). The PHP client in memcached's source tree (basically a
translation of the perl client) works this way, too.
In this setup, a small portion of each client's requests will be to a
server running on the same machine, and theoretically this small portion
of requests could be sped up by using a unix domain socket instead of
a TCP connection. We decided not to bother doing that because: 1) it'd
only speed up a small portion of requests anyway, by far the majority of
memcached requests are across the network; 2) it's convenient to work
with a unified list of servers (specified as host:port pairs), shared by
all the clients and easy to modify globally; 3) the speed-up in the few
tests I ran wasn't noticeable anyway, because communication in memcached
is just so very very fast that it's never the bottleneck. I mean, if you
run a standalone test pumping data across a TCP versus domain socket
connection on the same machine, you see a substantial difference, but with
memcached both turn out to be so fast as to be dwarfed by other
considerations.
What Antony quoted me about standalone installation was a warning to
*not* use just one instance of memcached server on the same machine as
clients are running on, and no other servers at all. We've seen cases
where people set up memcached in this way hoping to win something, but
it's just silly, because they'd
conserve memory much better and more efficiently by just using shared
memory on that machine. memcached treats speed of access,
speed of communication and long-term stability (i.e. no fragmentation
over time) as paramount and trades memory for it; its
strength comes from being used over a local backend network.
Please feel free to Cc me on replies to this, as I'm not subscribed to
the mailing list, or to ask any other questions about memcached.
--
avva