You can access and control your memcached installation, using simple telnet commands. Use ps -ef to determine on which port and ip you memcached server is running and connect to it:
telnet localhost 11211
The list of commands is as follows:
Get stored data
Returns the value stored for this key. You can specify more than one keys separated by spaces.
[set|add|replace|append|prepend] <key> <flags> <exp_time> <bytes> [no_reply]
The arguments are:
- flags: an arbitrary 16-bit unsigned integer (written out in decimal) that the server stores along with the data and sends back when the item is retrieved.
- exp_time: expiration time in seconds. If it’s 0, the item never expires (although it may be deleted from the cache to make place for other items).
- bytes: the number of bytes in the data block to follow, *not* including the delimiting \r\n. <bytes> may be zero (in which case it’s followed by an empty data block).
After the command hit Enter and input the data block of size <bytes>.
delete <key> [<time>] [noreply]
Delete a key.
- time: the amount of time in seconds (or Unix time until which) the client wishes the server to refuse “add” and “replace” commands with this key.
Flush all stored data
Flashes the entire cache.
Higher level statistics
Quit the telnet interface