zoukankan      html  css  js  c++  java
  • Memcached: List all keys

    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!

  • 相关阅读:
    2018年12月29日 Oracle查询性能优化
    B
    A
    洛谷 P2447 [SDOI2010]外星千足虫
    洛谷 P5358 [SDOI2019]快速查询
    欠的题目
    ZJU-ICPC Summer 2020 Contest 8 B-Picnic
    洛谷 P3164 [CQOI2014]和谐矩阵
    K
    J
  • 原文地址:https://www.cnblogs.com/wuxiang/p/5477049.html
Copyright © 2011-2022 走看看