The short answer: Either one is what you are looking for, but my first choice would be memcache (the first one you listed), purely based on its correct use of nomenclature.
Now here's how I came to that conclusion:
Here is a quick backgrounder in naming conventions (for those unfamiliar), which explains the frustration by the question asker: For many *nix applications, the piece that does the backend work is called a "daemon" (think "service" in Windows-land), while the interface or client application is what you use to control or access the daemon. The daemon is most often named the same as the client, with the letter "d" appended to it. For example "imap" would be a client that connects to the "imapd" daemon.
This naming convention is clearly being adhered to by memcache when you read the introduction to the memcache module (notice the distinction between memcache and memcached in this excerpt):
Memcache module provides handy
procedural and object oriented
interface to memcached, highly
effective caching daemon, which was
especially designed to decrease
database load in dynamic web
applications.
The Memcache module also provides a
session handler (memcache).
More information about memcached can
be found at »
http://www.danga.com/memcached/.
The frustration here is caused by the author of the PHP extension which was badly named memcached, since it shares the same name as the actual daemon called memcached. Notice also that in the introduction to memcached (the php module), it makes mention of libmemcached, which is the shared library (or API) that is used by the module to access the memcached daemon:
memcached is a high-performance,
distributed memory object caching
system, generic in nature, but
intended for use in speeding up
dynamic web applications by
alleviating database load.
This extension uses libmemcached
library to provide API for
communicating with memcached servers.
It also provides a session handler
(memcached).
Information about libmemcached can be
found at »
http://tangent.org/552/libmemcached.html.
In summary, both are functionally the same, but they simply have different authors, and the one is simply named more appropriately than the other.
As Mike said, you can look at the line including the "STAT bytes" to see memory usage:
$ echo "stats" | nc -w 1 <host> <port> | awk '$2 == "bytes" { print $2" "$3 }'
Best Answer
It's not as convenient as listing an interface and getting all of its bound addresses, and it requires knowing all the addresses bound to an interface, but it can be done. (Note that you cannot just list some interfaces, as you have discovered -- either a single interface, all interfaces, or a list of IPs.)
The
-l
option can take an interface, INADDR_ANY (which means all addresses on all interfaces), or a comma separated list of IP addresses. An IP address may have an optional port specification. So, for instancewill have memcached listen to lo0 only on 127.0.0.1 on ports 11211 and 11212 and also to the address 10.1.2.3 (on whichever interface it is) on whatever port is set by
-p
or-U
.You are required to know/have all the addresses you want to bind. This is perhaps a large gap between
lo0
and a list of IPs (since memcached's default internal resource limitations will not permit binding to the ~2^24 addresses on that interface)