DevLogs

dump memcached in linux shell

밥먹고해요 2017. 8. 24. 09:51
MEMCACHED_HOST=localhost
MEMCACHED_PORT=11211
printf "stats items\n" | nc $MEMCACHED_HOST $MEMCACHED_PORT | grep ":number" | awk -F":" '{print $2}' | xargs -I % printf "stats cachedump % 10000\r\n" | nc $MEMCACHED_HOST $MEMCACHED_PORT

[참고] http://infoheap.com/memcache-dump-all-keys-values-on-command-line