OpenVZ Forum


Home » Mailing lists » Users » fake swap != 0 in VE?
Re: fake swap != 0 in VE? (solved) [message #27274 is a reply to message #27272] Wed, 13 February 2008 14:24 Go to previous messageGo to previous message
Michael Klatsky is currently offline  Michael Klatsky
Messages: 3
Registered: December 2007
Junior Member
Would not the same effect be achived using OpenVZ builtin --meminfo
parameter to vzctl?

Example:

Before:

[root@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@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@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
-- 


Sincerely,

Michael Klatsky
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: openvz in domu (xen)
Next Topic: Network configuration
Goto Forum:
  


Current Time: Fri Aug 15 14:28:26 GMT 2025

Total time taken to generate the page: 0.30153 seconds