httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Marantz <>
Subject Re: apr_memcache vs libmemcached
Date Fri, 17 Aug 2012 17:38:30 GMT
Following up: I've been pretty successful using apr_memcache so far.  The
performance is roughly on par with a file-cache running on a tmpfs
partition, but of course it adds network scalability.  I'd encourage anyone
wanting to integrate memcached into Apache modules to give it a try.  It
might even be one of the easiest ways to get a map that can be used across
processes on a single server, rather than working with shared memory.

It *looks* like libmemcached has a richer API and the potential for better
performance due to asynchronous APIs and usage of the memcached binary
protocol, but I have not been as successful with it.  And apr_memcache
seems good enough, performance wise, based on my load tests, and so far
it's very stable.

Example usage:,


On Thu, Jul 19, 2012 at 5:47 PM, Joshua Marantz <> wrote:

> I think the point of that Wiki was that whoever wrote that entry claimed
> that apr_memcached wasn't being actively worked on, but perhaps that's
> false.  I don't think the implication was that the work was expected to
> happen in
> This question is in the context of mod_pagespeed<>,
> which currently uses the file system for caching that's visible across
> Apache child processes.  That works pretty well but has limitations in
> performance and network scope.  memcached is being considered as a possible
> replacement for that.
> I'll take a look at socache.
> One of the advantages of libmemcached is that it supports -- or claims to
> support -- asynchronous fetches, which we believe is important for
> performance at scale.  However, I have not actually been able to get that
> to work as expected, and have fallen back to a fairly synchronous model.
>  The libmemcached API *looks* asynchronous -- it just doesn't seem to quite
> work.   And if I'm going to stay synchronous then it might be a lot easier
> to integrate if I use the built in APR support.  And even synchronous
> fetches from memcached might be better than synchronous reads form disk.
> Thanks,
> -Josh
> On Thu, Jul 19, 2012 at 5:39 PM, Nick Kew <> wrote:
>> On Thu, 19 Jul 2012 16:41:51 -0400
>> Joshua Marantz <> wrote:
>> > Hi,
>> >
>> > Is anyone maintaining apr_memcache?  Or should I stick with
>> libmemcached?
>> >
>> > This page: suggests
>> > apr_memcached is not maintained.
>> Huh?  It's not maintained at google code since it was contributed
>> to the core APR project.  If you have any reasonably recent APR
>> installed (as you must have if you run httpd), it includes
>> apr_memcache.
>> Since you posted here I'd guess your purpose is writing a module?
>> You might want to look at the socache modules as a higher-level
>> abstraction.
>> --
>> Nick Kew

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message