pylibmc vs python-libmemcached vs cmemcache

1,430 views
Skip to first unread message

Jehiah Czebotar

unread,
Sep 23, 2009, 3:59:23 PM9/23/09
to memc...@googlegroups.com
It seems there are 3 memcached libraries for python now that wrap the
c libmemcached for use in python.

pylibmc - http://lericson.blogg.se/code/category/pylibmc.html
python-libmemcached - http://code.google.com/p/python-libmemcached/
cmemcache - http://gijsbert.org/cmemcache/index.html

Is anyone using these in a heavy production environment, are any more
reliable than any others? I havn't seen much discussion about any of
these in the list archives.

cmemcache lists some known problems (even important things like
crashing on disconnects)
pylibmc seems newer and appears to have the most active development

thoughts?

--
Jehiah

David Stanek

unread,
Sep 23, 2009, 4:11:24 PM9/23/09
to memc...@googlegroups.com

We (at my day job) have been happily using python-memcached[0] in
production for at least a year now. Our sites get a pretty good amount
of traffic. What is your definition of heavy?

[0] http://www.tummy.com/Community/software/python-memcached/

--
David
blog: http://www.traceback.org
twitter: http://twitter.com/dstanek

Jehiah Czebotar

unread,
Sep 23, 2009, 4:27:26 PM9/23/09
to memc...@googlegroups.com

I've been happily using python-memcached as well for a long time and
have contributed code to it; i am however specifically asking about
python-libmemcached, the one based on libmemcached not the pure python
client. (it is unfortunate that those two names are so similar)

--
Jehiah

dormando

unread,
Sep 23, 2009, 4:45:41 PM9/23/09
to memc...@googlegroups.com
I've not seen pylibmc yet, dunno which one is better...
You can discount 'cmemcache' outright, since it's based off of the
deprecated 'libmemcache' C library. Both were buggy.

David Stanek

unread,
Sep 23, 2009, 8:40:56 PM9/23/09
to memc...@googlegroups.com
On Wed, Sep 23, 2009 at 4:27 PM, Jehiah Czebotar <jeh...@gmail.com> wrote:
>
> I've been happily using python-memcached as well for a long time and
> have contributed code to it; i am however specifically asking about
> python-libmemcached, the one based on libmemcached not the pure python
> client. (it is unfortunate that those two names are so similar)
>

Any reason you are contemplating moving to a C-based library?

Jehiah Czebotar

unread,
Sep 23, 2009, 9:33:54 PM9/23/09
to memc...@googlegroups.com
On Wed, Sep 23, 2009 at 8:40 PM, David Stanek <dst...@dstanek.com> wrote:
>
> On Wed, Sep 23, 2009 at 4:27 PM, Jehiah Czebotar <jeh...@gmail.com> wrote:
>>
>> I've been happily using python-memcached as well for a long time and
>> have contributed code to it; i am however specifically asking about
>> python-libmemcached, the one based on libmemcached not the pure python
>> client. (it is unfortunate that those two names are so similar)
>>
>
> Any reason you are contemplating moving to a C-based library?
>

yes; the reason is that i have code in python, c and tcl which i want
to all use the same underlying library; and share the same cache pool
and data.

I understand the potential serialization problems with that and have a
handle on that; but i thought it would be least error prone if i could
use libmemcached across all three with the same hashing algorithm,
same use of flag values, etc.

--
Jehiah

Jehiah Czebotar

unread,
Sep 23, 2009, 9:35:55 PM9/23/09
to memc...@googlegroups.com
On Wed, Sep 23, 2009 at 4:45 PM, dormando <dorm...@rydia.net> wrote:
>
> I've not seen pylibmc yet, dunno which one is better...
> You can discount 'cmemcache' outright, since it's based off of the
> deprecated 'libmemcache' C library. Both were buggy.
>

thanks; i missed the character difference on the underlying cmemcache
library, so that is now off my list

Qiangning Hong

unread,
Sep 24, 2009, 2:11:14 AM9/24/09
to memc...@googlegroups.com

As the developer and maintainer of python-libmemcached, douban.com has
been using it in production for over years. We serve 20M+ pageview
per day and the python-libmemcached is pretty stable.

As for the development, we are coding and testing the UDP and binary
protocol support nowadays, and will release the new version after
that.

We've read Amix's benchmark at http://amix.dk/blog/viewEntry/19471 and
appreciate him to point out the performance issue under multi-thread
environment. As our usage is under single-thread environment, we
haven't pay too much effort to optimize it in that condition. We'll
take time to dig it out, but patches are welcome. Anyway, Pyrex is
much easier to read & write for python programmers than pure C
(Compare python-libmemcached's 609 lines of pyx code with pylibmc's
940 lines of C code. Not mention nearly 180 lines of the pyx code are
just re-declaration of C function prototype, not logic).

--
Qiangning Hong

Reply all
Reply to author
Forward
0 new messages