Memcache 查看列出所有key的方法

简介:

一个不错的列出memcache中所有key的方法,在某些场景下非常有用:


In the general case, there is no way to list all the keys that a memcached instance is storing. You can, however, list something like the first 1Meg of keys, which is usually enough during development. Here’s how:

Telnet to your server:

telnet 127.0.0.1 11211

List the items, to get the slab ids:

stats items

STAT items:3:number 1

STAT items:3:age 498

STAT items:22:number 1

STAT items:22:age 498

END


The first number after ‘items’ is the slab id. Request a cache dump for each slab id, with a limit for the max number of keys to dump:

stats cachedump 3 100

ITEM views.decorators.cache.cache_header..cc7d9 [6 b; 1256056128 s]

END

stats cachedump 22 100

ITEM views.decorators.cache.cache_page..8427e [7736 b; 1256056128 s]

END

Thanks to Boris Partensky in the Memcached group here

There you go!


原文:http://www.darkcoding.net/software/memcached-list-all-keys/


本文转自 古道卿 51CTO博客,原文链接:http://blog.51cto.com/gudaoqing/1400114

相关文章
AutoJS4.1.0实战教程 ---彩蛋视频自动答复
AutoJS4.1.0实战教程 ---彩蛋视频自动答复
111 0
|
域名解析 网络协议 应用服务中间件
PHP CURL指定host内网通信
PHP CURL指定host内网通信
433 1
PHP CURL指定host内网通信
HTML table表格元素边框修改为单线
HTML table表格元素边框修改为单线
160 0
|
分布式计算 DataWorks Java
DataWorks操作报错合集之dataworks 同步es数据到maxcompute 遇到报错:获取表列信息失败如何解决
DataWorks是阿里云提供的一站式大数据开发与治理平台,支持数据集成、数据开发、数据服务、数据质量管理、数据安全管理等全流程数据处理。在使用DataWorks过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
392 0
|
存储 程序员 Python
Python 基础语法入门
这个系列是去年的时候给西门子电力的工程师培训Python入门课程准备的讲义~ 分享出来,仅供学习~ 本节是《Python入门-1.2 基础语法入门》
5245 0
|
缓存 安全 Java
Java Stream 流详解
Java Stream(流)是Java 8引入的一个强大的新特性,用于处理集合数据。它提供了一种更简洁、更灵活的方式来操作数据,可以大大提高代码的可读性和可维护性。本文将详细介绍Java Stream流的概念、用法和一些常见操作。
460 0
|
设计模式 XML JSON
springMVC 工作原理和流程
springMVC 工作原理和流程
197 0
springMVC 工作原理和流程
|
PHP
php curl指定ip,php curl请求忽略本地host文件,php curl请求跳过本地host文件
php curl指定ip,php curl请求忽略本地host文件,php curl请求跳过本地host文件
366 0
|
SQL 关系型数据库 MySQL
报错:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregat
报错:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregat
823 0
报错:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregat
|
人工智能 程序员
创业之路 - 张一鸣:创业6年,估值750亿美元,人才不是核心竞争力,机制才是
创业之路 - 张一鸣:创业6年,估值750亿美元,人才不是核心竞争力,机制才是
903 0
创业之路 - 张一鸣:创业6年,估值750亿美元,人才不是核心竞争力,机制才是