New (experimental) C (and PHP) memcached library
alexs at advfn.com
Sat Apr 28 20:02:15 UTC 2007
Well I mentioned I had written a UDP capable C library for working
with memcached a couple of days ago and here it is. It requires
libketama, libevent and uses Boost.Build currently. Included is a PHP
library that provides access to it, and pretty much zero
documentation. There is a fairly comprehensive example program and a
test PHP script as well. It works pretty well but has not been tested
in any sort of failure scenario yet.
Here's the README with more info
cmemcache - C memcached client
authors: Alex Stapleton <alex.stapleton at gmail.com>
version: 0.5 - Dedicated to Varablese, the Greek God of
date: 28 Apr 2007
This is the first revision of this client, it seems to mostly work
doesn't report any massive memory issues with it. *crosses fingers*
probably usable. It supports TCP and UDP and relies on libketama,
Bost.Build. Links to dependencies are down below. Currently it is
servers are operating in both UDP and TCP mode with the UDP port 1
the TCP port listed in the ketama server file. This is a lame hack I
It should be pretty easy to add support to force a server to only do
The PHP module has been tested under PHP4 and PHP5. This extension
been used in a high load situation yet. Proper QA and bugfixing has not
been done. This is going to be happening over the next week or two as we
roll it out onto our web servers.
Get requests are sent aynchronously using libevent which means you
good performance using large numbers of servers for batch requests.
I am almost certain there are horrendously evil bugs in this code. If
breaks and loses your customers or sets your parents on fire, it's
not my fault.
You can only get it from SVN right now the repo is at
svn checkout http://cmemcache.googlecode.com/svn/trunk/ cmemcache
Just type bjam to build it (assuming you have Boost.Build v2 installed.)
I'd appreciate any feedback (especially in the form of patches ;) no
matter how scathing.
alexs at advfn.com
More information about the memcached