Skip to content

Instantly share code, notes, and snippets.

@pydevops
Last active June 12, 2017 17:35
Show Gist options
  • Select an option

  • Save pydevops/0d62aba3e357edb35c39ab8bb66373e1 to your computer and use it in GitHub Desktop.

Select an option

Save pydevops/0d62aba3e357edb35c39ab8bb66373e1 to your computer and use it in GitHub Desktop.
memcached
  • apt-get install libmemcached-tools
  • memcstat --servers=203.0.113.12 11211 | grep get_hits

get version

memcstat --servers=10.2.0.4 | grep version

dump keys

memcdump --servers=localhost

dump value given a key

memccat --servers=localhost "key"

get setting

echo "stats settings" | nc localhost 11211

get current memory usage

echo "stats" | nc -w 1 localhost 11211 | awk '$2 == "bytes" { print $2" "$3 }'

start in verbose mode

/usr/local/bin/memcached -vv

start with higher memory

/usr/local/bin/memcached -m 2048

flush all

echo 'flush_all' | nc localhost 11211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment