Joachim Bauernberger joachim.bauernberger at
Wed Nov 17 09:00:28 PST 2004

On Wednesday 17 November 2004 17:42, John Allspaw wrote:
> > Doesn't this misrepresent the protocol layers?  Memcached talks the
> > protocol documented in doc/protocol.txt over TCP, just like web servers
> > talk HTTP over TCP.  Applications that grok "raw TCP" would be things
> > like ethereal.
> yeah, looking back, I'm not happy with the way I described it.  by
> "raw" TCP I meant a non-HTTP upper level protocol.  again, for context
> I'm looking at it from the perspective of a network device like a load
> balancer, and to the majority of them, if it's not FTP or HTTP, then
> they don't really understand it at all, and can't do any of their more
> advanced mojo with those connections/requests.

Why not simply put Apache in front of it and have a fastcgi implementing the 
Cache::Memcached API. That should allow the loadbalancer to monitor your 
Additionally using apache (or similar) you get a well tested/maintained 
framework to handle your HTTP (rather than implementing it within memcached).
You don't even have to touch the loadbalancer configuration to add rules. 
Simply tell apache that you want documents from /htdocs/foobar to be handled 
by your memeched cgi-script.

For monitoringpurposes I use a key that is unique (HEALTHCHECK_FOOBAR) which 
is replaced by a call to the cgi script from a monitoring rule by the 
loadbalancer every 20 seconds or so.


> > This would be interesting, although kind of weird.  I could see the use
> > for this if you put a proxy or a port-80-only firewall between your
> > memcached servers and your memcached clients,
> like a load balancer. :)
> > but this seems like a
> > dubious network design considering where memcached is designed to be
> > placed on your network...
> agreed, but only in the instance where the load balancer is only on
> the *front end*, not on a lower tier.  I'm not at all suggesting
> putting memcached in front of the world....THAT would be weird, and
> possibly not a smart move...I'm now wondering if that's what people
> were thinking when I first asked the question.  :)
> in other words, imagine the memcached clients being webservers, and
> memcached servers acting like squid, but for databases.  squid can be
> manipulated six ways to sunday with load balancers because they talk
> HTTP, as well as anything else that can talk Sharp's Super
> Proxy:
> sorry for the confusion. :)
> -j

Phone: +49 (0) 89 490 267 - 726
Mobile: +49 (0) 179 674 3611
ICQ: 214527045 
PGP fingerprint =  8D EC 2C 9D 80 C0 42 42  92 8C 57 91 D0 4E 1B 26

More information about the memcached mailing list