0

I want to list all the keys stored in the memcached server.

I googled for the same, I got some python/php scripts that can list the same. I tested it but all went failed and none gave me full keys. I can see thousands of keys using telnet command

stats items

I used perl script that uses telnet to list keys, but that got failed too. I mean that script is listing keys but not all of them.

Do I need to reconfigure telnet ? Is there any other way ?

Steve
  • 213,761
  • 22
  • 232
  • 286
JohnG
  • 807
  • 1
  • 12
  • 20

2 Answers2

1

memcache does not provide an api to exhaustively list all keys. "stats items" is as good as it gets to list the first 1M of keys. More info here: http://www.darkcoding.net/software/memcached-list-all-keys/

Not sure if that helps you but redis (which could be considered a superset of memcache) provides a more comprehensive API for key listing and searching. You might want to give it a try.

Timothée Groleau
  • 1,940
  • 13
  • 16
0

It you use python-memcached, and would like to export all the items in memcache server, I summerized two methods to the problem in this question: Export all keys and values from memcached with python-memcache

Community
  • 1
  • 1
Good Will
  • 1,220
  • 16
  • 10