Subject: Re: [vserver] vserver guest memory usage: cache/buffers?
From: Herbert Poetzl <herbert@13thfloor.at>
Date: Mon, 28 Nov 2011 19:13:23 +0100

On Mon, Nov 28, 2011 at 05:39:44PM +0100, Jarry wrote:
> Hi,

> finally I managed memory limits to work using the old way
> using rss.hard and rss.soft (for whatever reason, cgroups
> simply did not work for me). But I'm a little surprised how
> memory is used/reported in this version (2.3.0.36.32):

from the version you list, I conclude that you are using
linux 2.6.35.2 - 2.6.35.7.

the Linux-VServer memory accounting was dropped in favor
of cgroups and 2.6.34.4-vs2.3.0.36.30.4 added a fake
entry to keep ancient tools happy (config option)

config VSERVER_LEGACY_MEM
       bool    "Legacy Memory Limits"
       default n
       help
         This provides fake memory limits to keep
         older tools happy in the face of memory
         cgroups

> vs6a / # free
>         total      used    free    shared  buffers  cached
> Mem:    524288     160324  363964  0       0        158424
> -/+ buffers/cache: 1900    522388
> Swap:   524288     0       524288

> I'm running one more older vserver-host (2.2.0.7), and there
> I never get anything for "cached":

> vs6b / # free
>         total       used   free    shared  buffers  cached
> Mem:    262144      6556   255588  0       0        0
> -/+ buffers/cache:  6556   255588
> Swap:   786432      0      786432

> I also see RSS-memory usage as reported by vserver-stat is
> now much higher:

mostly because if you do not use cgroups, you get
no accurate memory accounting at all, and util-vserver
falls back to simply summing up the guest processes

> (new) vserver-stat:
> CTX   PROC    VSZ    RSS  userTIME   sysTIME    UPTIME NAME
> 6000     3  88.5M 155.9M   0m15s54   0m01s94   8m11s53 vs6a

> (old) vserver-stat:
> CTX   PROC    VSZ    RSS  userTIME   sysTIME    UPTIME NAME
> 6000     3  90.7M     4M   0m01s57   0m00s65   1d03h06 vs6b

> There is absolutely the same software running (namely nothing
> but init, cron and syslog-ng), yet the old vserver-guest takes
> just 4MB of RSS, the new one takes 156MB! This corresponds
> with ~150MB used for disk-cache.

> Unfortunatelly, I can't compare memory usage of vserver-hosts,
> as there is different software running. So my question is:
> Was something changed in caching, concerning vserver-guests
> recently? Was it "moved" from vserver-host to vserver-guests?

no, nothing changed in caching, but if you want guest
specific memory accounting, you absolutely need to
enable and configure cgroups ... I'd also advise to
update to a more recent kernel/patch ...

best,
Herbert

> Jarry

> -- 
> _______________________________________________________________
> This mailbox accepts e-mails only from selected mailing-lists!
> Everything else is considered to be spam and therefore deleted.