How can i get all items?
aziem at revelex.com
Wed Apr 5 22:37:52 UTC 2006
Not only that, cachedump has a limited buffer (2MB?) and with memcached
holding and returning expired items, it was quite likely to run over
that limit. The only way to remove them is to request them again so
they are unlinked.
If you need to know what's in memcached, you're probably using it for
more than it was intended.
From: memcached-bounces at lists.danga.com
[mailto:memcached-bounces at lists.danga.com] On Behalf Of Brad Fitzpatrick
Sent: Wednesday, April 05, 2006 1:46 PM
To: Evan Fribourg
Cc: memcached at lists.danga.com
Subject: RE: How can i get all items?
"stats cachedump" is a debugging command, and not part of the stable
interface. Subject to change at any time.
On Wed, 5 Apr 2006, Evan Fribourg wrote:
> Actually it is possible, although not with one single command.
> First I'd issue a "stats slabs", which lists all of the currently
> allocated slabs in the format:
> STAT (slab_num):(stat_name) (data)
> Example output:
> STAT 7:chunk_size 128
> STAT 7:chunks_per_page 8192
> STAT 7:total_pages 1
> STAT 7:total_chunks 8192
> STAT 7:used_chunks 8164
> STAT 7:free_chunks 28
> STAT 7:free_chunks_end 8164
> STAT 8:chunk_size 256
> STAT 8:chunks_per_page 4096
> STAT 8:total_pages 1
> STAT 8:total_chunks 4096
> STAT 8:used_chunks 4095
> STAT 8:free_chunks 1
> STAT 8:free_chunks_end 4095
> Then, with some programming, it is possible to parse out and get a
> list of unique slabs that are in use.
> Then, for each slab, you can issue "stats cachedump (slab_num)" which
> returns item keys in the format:
> ITEM (key) [(size) b; (timestamp) s]
> Example output:
> ITEM b00a31dfc29cdf6d3207cbcb81d29fe0 [2756 b; 1144257378 s] ITEM
> a40fb247233320619da2d742e691774b [3329 b; 1144257375 s] ITEM
> fea811327b1ed962aaeecdc87d759fc0 [3334 b; 1144257362 s] ITEM
> 910c35ef914bd45b44b0f1148e3e8c34 [3540 b; 1144257347 s] ITEM
> 1115ac936267339093b53d11e9c16075 [2673 b; 1144257128 s]
> Based on reviewing the code, however, there is a limit to the size of
> the output buffer -- so if you have so many keys that the size of the
> output exceeds the ouput buffer, then you won't be able to retrieve
> all keys for that slab -- output would be truncated.
> -----Original Message-----
> From: memcached-bounces at lists.danga.com
> [mailto:memcached-bounces at lists.danga.com] On Behalf Of Brad
> Sent: Wednesday, April 05, 2006 12:54 AM
> To: csepinek at freemail.hu
> Cc: memcached at lists.danga.com
> Subject: Re: How can i get all items?
> On Wed, 5 Apr 2006 csepinek at freemail.hu wrote:
> > Hi all!
> > Could someone tell me, how can i get all cached items? For example I
> > wanna get all key.
> > Thanks before...
> > --
> > Best regards,
> > csepinek mailto:csepinek at freemail.hu
More information about the memcached