Here is a patch against the central repo that adds sFlow monitoring.
For background on this, please read:
If you compile with this patch, then you can run with "memcached -u
nobody -o sflow=on", and it will pick up configuration from /etc/
hsflowd.auto, such as:
"agentIP" should be the IP of the server, and "collector" should be
the IP of an sflow collector such as "sflowtool":
(This config file is generated automatically if you install hsflowd,
the host sFlow daemon from host-sflow.sourceforge.net
contributes an sFlow feed of server performance stats)
(1). Provided the sampling-rate is set appropriately, the overhead
should be roughly equivalent to adding one extra stats counter. The
critical path is just a decrement-and-test on a per-thread counter (no
(2). The changes are all within "#ifdef SFLOW" except for (3) below.
(3). I changed memcached.h:struct conn->request_addr to be of type
struct sockaddr_storage so it would work for IPv6 too.