Couldn't retrieve all the memcache keys via telnet client
Asked Answered
O

2

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 ?

Oeuvre answered 23/2, 2013 at 13:9 Comment(0)
W
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.

Weathercock answered 23/2, 2013 at 13:15 Comment(0)
O
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

Olympia answered 5/1, 2015 at 13:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.