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.
# memcached -u memcached -d -m 30 -l 127.0.0.1 -p 11211
You'll notice there is "-l 127.0.0.1
" in your command line. This tells memcached
to only listen on the lo interface. If you want to access it from a remote machine, you need to remove this part of the command line.
Best Answer
By default memcached only serves the localhost as it otherwise has no protection from the wider network / internet and is insecure. As you see in the output you posted it's currently only serving connections over 127.0.0.1:
So, you need to edit the configuration file and give it the IP address of the network interface that you want to serve. To do this head over to the directory where the config file is located. On ubuntu, this is:
Then open the config file in your editor of choice:
Then scrol down until you find this:
Now just replace
127.0.0.1
with the IP of your network interface and save.Now you'll need to restart the memcached server:
Memcached will now be serving only requests received via that IP/network interface. You can test this with the following command:
If everything went ok, you should see the IP you entered in the config rather than the localhost.