Memcached dump first couple of keys for introspection
1 min readAug 26, 2015
# connect to the redis instance
telnet 127.0.0.1 11211#List items
stats items# get info
stats cachedump 5 100# Flush
flush_all
Flush Memcached from CLI
echo ‘flush_all’ | netcat localhost 11211
Get Memcached Total Usage
echo "stats" | nc 127.0.0.1 11211 | grep bytesecho "stats" | nc -w 1 localhost 11211 | awk '$2 == "bytes" { print $2" "$3 }'
Configure Memcached params & restart
sudo nano /etc/memcached.conf
# Start with a cap of 64 megs of memory. It’s reasonable, and the daemon default
-m 14096# File size
-I 128M# restart
sudo service memcached restart
Memcached Errors faced:
Make sure that your key doesnt contain spaces in it !
WriteError: error 5 from memcached_set: (xxxxxx) CONNECTION FAILURE(Transport endpoint is not connected), host: 127.0.0.1:11211SocketCreateError: error 11 from memcached_set: SUCCESS