Listing all of the objects in memcached would be very non-performant and would block updates and adds. Why do you want to see the list?
Josef
"If you see a whole thing - it seems that it's always beautiful. Planets, lives... But up close a world's all dirt and rocks. And day to day, life's a hard job, you get tired, you lose the pattern." Ursula K. Le Guin
I have an aplication (not made by me) and i have to rewrite some parts
of the code, and it would come very handy to have the list of all the
objects in cache so i know how to call them without going through the
entire code looking for the name of each object.
On Jul 16, 5:27 pm, "Josef Finsel" <carpd...@gmail.com> wrote:
> Listing all of the objects in memcached would be very non-performant and
> would block updates and adds. Why do you want to see the list?
> Josef
> "If you see a whole thing - it seems that it's always beautiful. Planets,
> lives... But up close a world's all dirt and rocks. And day to day, life's a
> hard job, you get tired, you lose the pattern."
> Ursula K. Le Guin
> On Wed, Jul 16, 2008 at 4:07 PM, HE <emilianohorc...@gmail.com> wrote:
> > Is there any way (a function maybe) to list all the objects that i
> > have on memcache?.
> > is there a way to see that?.
On Wed, Jul 16, 2008 at 3:32 PM, HE <emilianohorc...@gmail.com> wrote:
> I have an aplication (not made by me) and i have to rewrite some parts > of the code, and it would come very handy to have the list of all the > objects in cache so i know how to call them without going through the > entire code looking for the name of each object.
>> Listing all of the objects in memcached would be very non-performant and >> would block updates and adds. Why do you want to see the list?
>> Josef
>> "If you see a whole thing - it seems that it's always beautiful. Planets, >> lives... But up close a world's all dirt and rocks. And day to day, life's a >> hard job, you get tired, you lose the pattern." >> Ursula K. Le Guin
>> On Wed, Jul 16, 2008 at 4:07 PM, HE <emilianohorc...@gmail.com> wrote:
>> > Is there any way (a function maybe) to list all the objects that i >> > have on memcache?. >> > is there a way to see that?.
> On Wed, Jul 16, 2008 at 3:32 PM, HE <emilianohorc...@gmail.com> wrote:
> > I have an aplication (not made by me) and i have to rewrite some parts
> > of the code, and it would come very handy to have the list of all the
> > objects in cache so i know how to call them without going through the
> > entire code looking for the name of each object.
> >> Listing all of the objects in memcached would be very non-performant and
> >> would block updates and adds. Why do you want to see the list?
> >> Josef
> >> "If you see a whole thing - it seems that it's always beautiful. Planets,
> >> lives... But up close a world's all dirt and rocks. And day to day, life's a
> >> hard job, you get tired, you lose the pattern."
> >> Ursula K. Le Guin
> >> On Wed, Jul 16, 2008 at 4:07 PM, HE <emilianohorc...@gmail.com> wrote:
> >> > Is there any way (a function maybe) to list all the objects that i
> >> > have on memcache?.
> >> > is there a way to see that?.
By "name of each object" do you mean memcached key? IF you want to dump the keys once to see what they are, you can use stats command. It is blocking and will take awhile, but this will serve your purpose I guess.
On Wed, Jul 16, 2008 at 4:32 PM, HE <emilianohorc...@gmail.com> wrote:
> I have an aplication (not made by me) and i have to rewrite some parts > of the code, and it would come very handy to have the list of all the > objects in cache so i know how to call them without going through the > entire code looking for the name of each object.
> > Listing all of the objects in memcached would be very non-performant and > > would block updates and adds. Why do you want to see the list?
> > Josef
> > "If you see a whole thing - it seems that it's always beautiful. Planets, > > lives... But up close a world's all dirt and rocks. And day to day, > life's a > > hard job, you get tired, you lose the pattern." > > Ursula K. Le Guin
> > On Wed, Jul 16, 2008 at 4:07 PM, HE <emilianohorc...@gmail.com> wrote:
> > > Is there any way (a function maybe) to list all the objects that i > > > have on memcache?. > > > is there a way to see that?.
> By "name of each object" do you mean memcached key? IF you want to dump the
> keys once to see what they are, you can use stats command. It is blocking
> and will take awhile, but this will serve your purpose I guess.
> On Wed, Jul 16, 2008 at 4:32 PM, HE <emilianohorc...@gmail.com> wrote:
> > I have an aplication (not made by me) and i have to rewrite some parts
> > of the code, and it would come very handy to have the list of all the
> > objects in cache so i know how to call them without going through the
> > entire code looking for the name of each object.
> > > Listing all of the objects in memcached would be very non-performant and
> > > would block updates and adds. Why do you want to see the list?
> > > Josef
> > > "If you see a whole thing - it seems that it's always beautiful. Planets,
> > > lives... But up close a world's all dirt and rocks. And day to day,
> > life's a
> > > hard job, you get tired, you lose the pattern."
> > > Ursula K. Le Guin
> > > On Wed, Jul 16, 2008 at 4:07 PM, HE <emilianohorc...@gmail.com> wrote:
> > > > Is there any way (a function maybe) to list all the objects that i
> > > > have on memcache?.
> > > > is there a way to see that?.
HE; what you should probably do is write a wrapper around the original application's memcached get/set/etc commands and have it log the keys its using. Then use that log to interact with the application.
> On Jul 16, 5:43 pm, "Boris Partensky" <boris.parten...@gmail.com>
> wrote:
>> By "name of each object" do you mean memcached key? IF you want to dump the
>> keys once to see what they are, you can use stats command. It is blocking
>> and will take awhile, but this will serve your purpose I guess.
>> On Wed, Jul 16, 2008 at 4:32 PM, HE <emilianohorc...@gmail.com> wrote:
>>> I have an aplication (not made by me) and i have to rewrite some parts
>>> of the code, and it would come very handy to have the list of all the
>>> objects in cache so i know how to call them without going through the
>>> entire code looking for the name of each object.
>>>> Listing all of the objects in memcached would be very non-performant and
>>>> would block updates and adds. Why do you want to see the list?
>>>> Josef
>>>> "If you see a whole thing - it seems that it's always beautiful. Planets,
>>>> lives... But up close a world's all dirt and rocks. And day to day,
>>> life's a
>>>> hard job, you get tired, you lose the pattern."
>>>> Ursula K. Le Guin
>>>> On Wed, Jul 16, 2008 at 4:07 PM, HE <emilianohorc...@gmail.com> wrote:
>>>>> Is there any way (a function maybe) to list all the objects that i
>>>>> have on memcache?.
>>>>> is there a way to see that?.
Ok, you need to use a combination of "stats items" and "stats cachedump" commands. Basically, stats items spits out stats for each slab class. Part of that stats is slab class id, which (along with limit number) you need to pass to "stats cachedump". Of course you need to do it on every server. Alternatively, if you use java whalin client, it kind of supports it already, you just need to call statsItems, parse out slab id and call statsCacheDump (or something like this, check out this link http://www.google.com/codesearch?hl=en&q=memcached+stats+lang:java+sh... ). Here is what I just did on my dev machine and got some keys listed:
marfa:~ boris$ nc localhost 11211 stats items STAT items:1:number 53 STAT items:1:age 91710 STAT items:2:number 61 STAT items:2:age 91710 STAT items:3:number 6 STAT items:3:age 76285 STAT items:13:number 2 STAT items:13:age 91710 STAT items:14:number 9 STAT items:14:age 76938 STAT items:15:number 8 STAT items:15:age 76302 STAT items:16:number 2 STAT items:16:age 76264 END stats cachedump 15 100 ITEM UserMemcache_0_19680722 [2036 b; 1216152837 s] ITEM UserMemcache_0_19680718 [1790 b; 1216152837 s] ITEM UserMemcache_0_19680717 [1790 b; 1216152837 s] ITEM UserMemcache_0_19680719 [1790 b; 1216152837 s] ITEM UserMemcache_0_19680707 [1786 b; 1216152837 s] ITEM UserMemcache_0_19680708 [2020 b; 1216152837 s] ITEM UserMemcache_0_19680709 [1833 b; 1216152837 s] ITEM UserMemcache_0_19680706 [1922 b; 1216152837 s] END
On Wed, Jul 16, 2008 at 4:45 PM, HE <emilianohorc...@gmail.com> wrote:
> ok, how can i do that?
> On Jul 16, 5:43 pm, "Boris Partensky" <boris.parten...@gmail.com> > wrote: > > By "name of each object" do you mean memcached key? IF you want to dump > the > > keys once to see what they are, you can use stats command. It is > blocking > > and will take awhile, but this will serve your purpose I guess.
> > On Wed, Jul 16, 2008 at 4:32 PM, HE <emilianohorc...@gmail.com> wrote:
> > > I have an aplication (not made by me) and i have to rewrite some parts > > > of the code, and it would come very handy to have the list of all the > > > objects in cache so i know how to call them without going through the > > > entire code looking for the name of each object.
> > > > Listing all of the objects in memcached would be very non-performant > and > > > > would block updates and adds. Why do you want to see the list?
> > > > Josef
> > > > "If you see a whole thing - it seems that it's always beautiful. > Planets, > > > > lives... But up close a world's all dirt and rocks. And day to day, > > > life's a > > > > hard job, you get tired, you lose the pattern." > > > > Ursula K. Le Guin
> > > > On Wed, Jul 16, 2008 at 4:07 PM, HE <emilianohorc...@gmail.com> > wrote:
> > > > > Is there any way (a function maybe) to list all the objects that i > > > > > have on memcache?. > > > > > is there a way to see that?.
That does not list all keys. It lists keys up to a certain buffer size (a meg?). It's also a really horrible habit to get into in case you end up relying on this and roll into production.
On Wed, 16 Jul 2008, Boris Partensky wrote:
> Ok, you need to use a combination of "stats items" and "stats cachedump" commands.
> Basically, stats items spits out stats for each slab class. Part of that stats is slab class id, which (along with limit number) you need to pass to "stats cachedump".
> Of course you need to do it on every server. Alternatively, if you use java whalin client, it kind of supports it already, you just need to call statsItems, parse out slab id and call statsCacheDump (or something
> like this, check out this link
> http://www.google.com/codesearch?hl=en&q=memcached+stats+lang:java+sh...).
> Here is what I just did on my dev machine and got some keys listed:
> marfa:~ boris$ nc localhost 11211
> stats items
> STAT items:1:number 53
> STAT items:1:age 91710
> STAT items:2:number 61
> STAT items:2:age 91710
> STAT items:3:number 6
> STAT items:3:age 76285
> STAT items:13:number 2
> STAT items:13:age 91710
> STAT items:14:number 9
> STAT items:14:age 76938
> STAT items:15:number 8
> STAT items:15:age 76302
> STAT items:16:number 2
> STAT items:16:age 76264
> END
> stats cachedump 15 100
> ITEM UserMemcache_0_19680722 [2036 b; 1216152837 s]
> ITEM UserMemcache_0_19680718 [1790 b; 1216152837 s]
> ITEM UserMemcache_0_19680717 [1790 b; 1216152837 s]
> ITEM UserMemcache_0_19680719 [1790 b; 1216152837 s]
> ITEM UserMemcache_0_19680707 [1786 b; 1216152837 s]
> ITEM UserMemcache_0_19680708 [2020 b; 1216152837 s]
> ITEM UserMemcache_0_19680709 [1833 b; 1216152837 s]
> ITEM UserMemcache_0_19680706 [1922 b; 1216152837 s]
> END
> On Wed, Jul 16, 2008 at 4:45 PM, HE <emilianohorc...@gmail.com> wrote:
> ok, how can i do that?
> On Jul 16, 5:43 pm, "Boris Partensky" <boris.parten...@gmail.com>
> wrote:
> > By "name of each object" do you mean memcached key? IF you want to dump the
> > keys once to see what they are, you can use stats command. It is blocking
> > and will take awhile, but this will serve your purpose I guess.
> > On Wed, Jul 16, 2008 at 4:32 PM, HE <emilianohorc...@gmail.com> wrote:
> > > I have an aplication (not made by me) and i have to rewrite some parts
> > > of the code, and it would come very handy to have the list of all the
> > > objects in cache so i know how to call them without going through the
> > > entire code looking for the name of each object.
> > > > Listing all of the objects in memcached would be very non-performant and
> > > > would block updates and adds. Why do you want to see the list?
> > > > Josef
> > > > "If you see a whole thing - it seems that it's always beautiful. Planets,
> > > > lives... But up close a world's all dirt and rocks. And day to day,
> > > life's a
> > > > hard job, you get tired, you lose the pattern."
> > > > Ursula K. Le Guin
> > > > On Wed, Jul 16, 2008 at 4:07 PM, HE <emilianohorc...@gmail.com> wrote:
> > > > > Is there any way (a function maybe) to list all the objects that i
> > > > > have on memcache?.
> > > > > is there a way to see that?.
On Wed, Jul 16, 2008 at 8:14 PM, dormando <dorma...@rydia.net> wrote: > That does not list all keys. It lists keys up to a certain buffer size (a > meg?). > It's also a really horrible habit to get into in case you end up relying > on this and roll into production.
> -Dormando
> On Wed, 16 Jul 2008, Boris Partensky wrote:
> > Ok, you need to use a combination of "stats items" and "stats cachedump" > commands. > > Basically, stats items spits out stats for each slab class. Part of that > stats is slab class id, which (along with limit number) you need to pass to > "stats cachedump". > > Of course you need to do it on every server. Alternatively, if you use > java whalin client, it kind of supports it already, you just need to call > statsItems, parse out slab id and call statsCacheDump (or something > > like this, check out this link
> > marfa:~ boris$ nc localhost 11211 > > stats items > > STAT items:1:number 53 > > STAT items:1:age 91710 > > STAT items:2:number 61 > > STAT items:2:age 91710 > > STAT items:3:number 6 > > STAT items:3:age 76285 > > STAT items:13:number 2 > > STAT items:13:age 91710 > > STAT items:14:number 9 > > STAT items:14:age 76938 > > STAT items:15:number 8 > > STAT items:15:age 76302 > > STAT items:16:number 2 > > STAT items:16:age 76264 > > END > > stats cachedump 15 100 > > ITEM UserMemcache_0_19680722 [2036 b; 1216152837 s] > > ITEM UserMemcache_0_19680718 [1790 b; 1216152837 s] > > ITEM UserMemcache_0_19680717 [1790 b; 1216152837 s] > > ITEM UserMemcache_0_19680719 [1790 b; 1216152837 s] > > ITEM UserMemcache_0_19680707 [1786 b; 1216152837 s] > > ITEM UserMemcache_0_19680708 [2020 b; 1216152837 s] > > ITEM UserMemcache_0_19680709 [1833 b; 1216152837 s] > > ITEM UserMemcache_0_19680706 [1922 b; 1216152837 s] > > END
> > On Wed, Jul 16, 2008 at 4:45 PM, HE <emilianohorc...@gmail.com> wrote:
> > ok, how can i do that?
> > On Jul 16, 5:43 pm, "Boris Partensky" <boris.parten...@gmail.com> > > wrote: > > > By "name of each object" do you mean memcached key? IF you want > to dump the > > > keys once to see what they are, you can use stats command. It is > blocking > > > and will take awhile, but this will serve your purpose I guess.
> > > On Wed, Jul 16, 2008 at 4:32 PM, HE <emilianohorc...@gmail.com> wrote:
> > > > I have an aplication (not made by me) and i have to rewrite some > parts > > > > of the code, and it would come very handy to have the list of all the > > > > objects in cache so i know how to call them without going through the > > > > entire code looking for the name of each object.
> > > > > Listing all of the objects in memcached would be very > non-performant and > > > > > would block updates and adds. Why do you want to see the list?
> > > > > Josef
> > > > > "If you see a whole thing - it seems that it's always beautiful. > Planets, > > > > > lives... But up close a world's all dirt and rocks. And day to day, > > > > life's a > > > > > hard job, you get tired, you lose the pattern." > > > > > Ursula K. Le Guin
> > > > > On Wed, Jul 16, 2008 at 4:07 PM, HE <emilianohorc...@gmail.com> > wrote:
> > > > > > Is there any way (a function maybe) to list all the objects that > i > > > > > > have on memcache?. > > > > > > is there a way to see that?.
I just copy an older message I posted one day on list:
you can have a little data usage report sniffing the network: ngrep -W none -T -d any "^(get|set|delete|END|STORED|VALUE|DELETED)" port 11211 | awk '{print $1 " " $2}'
or without the awk.
It's just plain keys and return values, but it can be useful to have a look at what is used in cache.
On Wed, Jul 16, 2008 at 10:45 PM, HE <emilianohorc...@gmail.com> wrote:
> ok, how can i do that?
> On Jul 16, 5:43 pm, "Boris Partensky" <boris.parten...@gmail.com> > wrote: >> By "name of each object" do you mean memcached key? IF you want to dump the >> keys once to see what they are, you can use stats command. It is blocking >> and will take awhile, but this will serve your purpose I guess.
>> On Wed, Jul 16, 2008 at 4:32 PM, HE <emilianohorc...@gmail.com> wrote:
>> > I have an aplication (not made by me) and i have to rewrite some parts >> > of the code, and it would come very handy to have the list of all the >> > objects in cache so i know how to call them without going through the >> > entire code looking for the name of each object.
>> > > Listing all of the objects in memcached would be very non-performant and >> > > would block updates and adds. Why do you want to see the list?
>> > > Josef
>> > > "If you see a whole thing - it seems that it's always beautiful. Planets, >> > > lives... But up close a world's all dirt and rocks. And day to day, >> > life's a >> > > hard job, you get tired, you lose the pattern." >> > > Ursula K. Le Guin
>> > > On Wed, Jul 16, 2008 at 4:07 PM, HE <emilianohorc...@gmail.com> wrote:
>> > > > Is there any way (a function maybe) to list all the objects that i >> > > > have on memcache?. >> > > > is there a way to see that?.
Thanx to everyone.
There are a lot of good answers.
I guess im going to do a log to the aplication so i can read the keys
an time they where made on. It´s what i nead.
Thank again everyone.
HE
On Jul 17, 3:05 am, "Ludovic Levesque" <lud...@gmail.com> wrote:
> I just copy an older message I posted one day on list:
> you can have a little data usage report sniffing the network:
> ngrep -W none -T -d any "^(get|set|delete|END|STORED|VALUE|DELETED)"
> port 11211 | awk '{print $1 " " $2}'
> or without the awk.
> It's just plain keys and return values, but it can be useful to have a
> look at what is used in cache.
> Hope it helps
> Ludovic
> On Wed, Jul 16, 2008 at 10:45 PM, HE <emilianohorc...@gmail.com> wrote:
> > ok, how can i do that?
> > On Jul 16, 5:43 pm, "Boris Partensky" <boris.parten...@gmail.com>
> > wrote:
> >> By "name of each object" do you mean memcached key? IF you want to dump the
> >> keys once to see what they are, you can use stats command. It is blocking
> >> and will take awhile, but this will serve your purpose I guess.
> >> On Wed, Jul 16, 2008 at 4:32 PM, HE <emilianohorc...@gmail.com> wrote:
> >> > I have an aplication (not made by me) and i have to rewrite some parts
> >> > of the code, and it would come very handy to have the list of all the
> >> > objects in cache so i know how to call them without going through the
> >> > entire code looking for the name of each object.
> >> > > Listing all of the objects in memcached would be very non-performant and
> >> > > would block updates and adds. Why do you want to see the list?
> >> > > Josef
> >> > > "If you see a whole thing - it seems that it's always beautiful. Planets,
> >> > > lives... But up close a world's all dirt and rocks. And day to day,
> >> > life's a
> >> > > hard job, you get tired, you lose the pattern."
> >> > > Ursula K. Le Guin
> >> > > On Wed, Jul 16, 2008 at 4:07 PM, HE <emilianohorc...@gmail.com> wrote:
> >> > > > Is there any way (a function maybe) to list all the objects that i
> >> > > > have on memcache?.
> >> > > > is there a way to see that?.