How do I see if memcached is already running on my chosen port?

barclay picture barclay · Nov 6, 2009 · Viewed 78.4k times · Source

I am having some problems with memcached and one idea I am having is that perhaps it is already running on the port I am trying to run it on, started by some other user on our network. Is there a way to tell what memcached ports are currently in use?

Answer

simoes picture simoes · Oct 24, 2011

To see if it is running you could also try telnetting into the port:

telnet localhost 11211

If this works you will see the following (telling you that the given port is open):

Connected to localhost.
Escape character is '^]'.

Now if memcached IS running you can see some basic stats by issuing the given command:

stats

If this fails you will know that memcached is not running.