[Users] fake swap != 0 in VE? (solved)

Michael Klatsky michaelk at tnrglobal.com
Wed Feb 13 09:24:31 EST 2008


Would not the same effect be achived using OpenVZ builtin --meminfo
parameter to vzctl?

Example:

Before:

[root at vz-210 /]# free -m
             total       used       free     shared    buffers     cached
Mem:          4050         21       4028          0          0          0
-/+ buffers/cache:         21       4028
Swap:            0          0          0

Then, do:
vzctl set 210 --meminfo=none

Now:
[root at vz-210 /]# free -m
             total       used       free     shared    buffers     cached
Mem:          4050       1963       2087          0         84       1655
-/+ buffers/cache:        223       3826
Swap:         2047          0       2047

Good discussion as I am having issues with certain applications that
apparently need swap.

MK

On 2/13/08, Dariush Pietrzak <ml-openvz-eyck at ddiary.eu> wrote:
> On Wed, 13 Feb 2008, Thomas Sattler wrote:
>
> > >Why not
> > >mount --bind fakememinfo /proc/meminfo
> > >inside the VE? Would be easiest, but the
> > >contents will not match real meminfo
> > >because they do not get updated.
> >
> > I didn't expect this to work ...
> > ... But it does. :-)
> >
> > I attached a little script to be run as root
> > inside a VE to fake swap. 512MB are default,
> > you can change it on the commandline:
>
>  Hmm, I find it strange that such hacks are needed, especially when openvz
> already does do some kind of virtualization of /proc/meminfo (if I'm
> interpreting this correctly, it sets max-mem from userbeancounters barrier
> on VE start, but subsequent online changes are ignored)
> --
> Key fingerprint = 40D0 9FFB 9939 7320 8294  05E0 BCC7 02C4 75CC 50D9
>  Total Existance Failure
> _______________________________________________
> Users mailing list
> Users at openvz.org
> https://openvz.org/mailman/listinfo/users
>


-- 


Sincerely,

Michael Klatsky


More information about the Users mailing list