Subject: Re: [vserver] which guest hit the memory limit?
From: Herbert Poetzl <herbert@13thfloor.at>
Date: Sat, 8 Aug 2009 14:22:01 +0200

On Wed, Aug 05, 2009 at 11:16:10AM -0400, Edward Capriolo wrote:
> On Wed, Aug 5, 2009 at 5:04 AM, Rik Bobbaers<rik@enzoverder.be> wrote:
> >> first, this is no virtual machine. :)
> >> second, there is no method to reset the hit counter
> >> but there is one to reset the min/max ... this is
> >> mainly because there is no real point in resetting
> >> the counter (at least IMHO :)
> >>
> >> best,
> >> Herbert
> >>
> >> PS: it would be trivial to add this, if you can
> >> provide a good argument why that would be useful :)
> >
> > i can take this one...
> > if you know for example, that your machine went "over its limits" on an
> > import of a database, compile of "something", or just a batch task... and
> > you KNOW it does that once at startup, or each night, but you want to
> > check if it happens again afterward. it's easier to do your heavy
> > computations, when it's settled, reset counters and see if in "normal
> > operation", it happens too.
> >
> > say i have a webserver running , but each morning i need to load some
> > shitload of pictures to it which makes it prone to memory problems, but i
> > know, i don't care... it would be nice to reset to 0, then test/see if it
> > remains 0 for the rest of the time
> >
> > good reason or not? i don't know, but a reset button on counters is always
> > a good idea imho :)
> >
> > Rik Bobbaers
> >
> > -- http://harry.enzoverder.be
> > linux/unix/system/network/security/hardware/DR admin
> >
> >
> 
> I can make a use case for always wanting a reset as a user feature.
> 
> Enter busy NFS servers. I want to be able to graph clients and servers
> to see, who is using the most NFS ops. Enter a 32 bit OS level
> counter, a counter that has been 32 bit for over 6 years of bug
> reporting.
> http://www.freebsd.org/cgi/query-pr.cgi?pr=103682&cat=bin
> 
> Eventually you hit a wrap around condition (this may not be the case
> with vserver). The only way to fix it is restart/reboot.
> 
> That stinks! because you spend half your life bragging about high *nux
> uptime but then you need to reboot/restart for your counters, and you
> lose your bragging rights. With a 64 bit counter needed a reset is
> unlikely, but if they are 32 bit it does come into play. So yes reset
> is always useful for stat guru's like myself :)

well, as I said, it's fairly trivial to do, and honoring the
fact that this 'feature' seems to be quite interresting to the
community (compared with e.g. disk limits :), here is a patch
(compile tested) which implements it:

http://vserver.13thfloor.at/ExperimentalT/delta-resethits-feat01.diff

you should be able to reset the hit count for a guest with
this command (until util-vserver adds support in vlimit)

 vcmd -i <xid> -C reset_hits

let me know if it works for you :)

best,
Herbert