Memory & SWAP [message #9791] |
Mon, 22 January 2007 21:08 ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
devonblzx
Messages: 127 Registered: December 2006
|
Senior Member |
|
|
All right,
After reading a few discussions on these forums, I think I'm getting a partial hang of it...but I still want some clarification.
free -m, when --meminfo privvmpages:1 is set returns the "physpages", right? So why is there such a gap between my physpages and whats actually being used in privvmpages?
vzmemcheck -vA returns this:
Output values in Mbytes
veid LowMem LowMem RAM MemSwap MemSwap Alloc Alloc Alloc
util commit util util commit util commit limit
1 6.15 13.61 90.50 90.50 37.61 250.94 1037.61 1037.61
-------------------------------------------------------------------------
Summary: 6.15 13.61 90.50 90.50 37.61 250.94 1037.61 1037.61
1579.00 1579.00 3949.00 10093.00 10093.00 10093.00 10093.00 10093.00
I realize the kernel memory isn't included, but free -m returns 84MB being used and in privvmpages, it says I'm using ~250MB.
Also where does SWAP come into play? I have 4GB of RAM and 6GB swap partition but it seems that the SWAP is never used even when a VPS is maxed out on RAM usage. I started getting fork errors but I still had 0/6GB Swap usage.
Is there a setting I should set for how much SWAP a VPS can use? Or do I set privvmpages for SWAP + RAM and then maybe vmguarpages for just RAM?
Any help would be greatly appreciated!
Thanks,
Devon
[EDIT]
Maybe someone can give me some exact values...
I want a VPS with 1024MB RAM and 1024MB SWAP available, right now I have privvmpages and vmguarpages to 262144.
![http://static.openvz.org/userbars/openvz-user-2.png](http://static.openvz.org/userbars/openvz-user-2.png)
ByteOnSite President
[Updated on: Mon, 22 January 2007 21:11] Report message to a moderator
|
|
|
|
|
|
|
Re: Memory & SWAP [message #9823 is a reply to message #9822] |
Wed, 24 January 2007 04:14 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
rickb
Messages: 368 Registered: October 2006
|
Senior Member |
|
|
As xemul said.. the VE has no concept of the difference between ram and swap. Its just "memory" at the VE level. So, your HN can have 64MB of ram and 64GB of swap. Or, your HN can have 64GB of ram and 64MB of swap. In the VE, the privvm, oomguar, vmguar are uneffected by this. Only the performance changes between the two scenarios. In either case, you can guarantee and limit each VE to an arbitrary amount of memory. This drastically differs from the conventional mem management of vmware/xen (isoloation). VZ is a shared kernel model and no resources are "hard dedicated" or "hard assigned".
-not possible to give/assign/guarantee a VE XX swap and YY physical memory
-not possible to restrict a VE from using physical memory and use swap instead
Think of the VZ virtual servers like resource containers, not individual linux boxes- VZ is a shared kernel approach to virtualization.
Hope this clears it up for you.
Rick Blundell
-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions
UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
|
|
|
|
Re: Memory & SWAP [message #9834 is a reply to message #9824] |
Wed, 24 January 2007 14:27 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
rickb
Messages: 368 Registered: October 2006
|
Senior Member |
|
|
This is your same question reworded.
Think of a normal linux kernel with two instances of Apache. Now, can you tell the kernel to allow each to allocate XX MB of physical mem and YY MB of swap?- no you cannot. Now, think of each of those apaches being a VZ VE. Bottom line, in this simple scenario, the same memory manager is used on the HN vs. a conventional kernel. The only differences is that the kernel can reap back memory to enforce guarantees (vmguar+oomguar) or apply an upper alloc limit (privvm).
Quote: | So when I give 1GB burstable RAM that will give them the ability to use that but they won't necessarily be using the SWAP but when the physical RAM does runs out the new memory left over memory will be SWAP, right?
|
I already answered this with:
Quote: |
not possible to give/assign/guarantee a VE XX swap and YY physical memory
|
----------------------
Quote: |
So I can give 512MB to 1GB burst even though I don't have the physical RAM to support it?
|
I already answered this with:
Quote: |
you can guarantee and limit each VE to an arbitrary amount of memory.
|
-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions
UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
[Updated on: Wed, 24 January 2007 14:30] Report message to a moderator
|
|
|
|
Re: Memory & SWAP [message #37763 is a reply to message #9834] |
Sun, 18 October 2009 13:10 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) |
poige
Messages: 2 Registered: January 2009
|
Junior Member |
|
|
Quote: | Think of a normal linux kernel with two instances of Apache. Now, can you tell the kernel to allow each to allocate XX MB of physical mem and YY MB of swap?- no you cannot. Now, think of each of those apaches being a VZ VE.
|
Ok, but OpenVZ is kernel level software and comparing it to Apache's looking wrong. The real problem is that OpenVZ doesn't support swap space partitioning (i. e., one can not say "ok, this instance can have as much as N MiBs/GiBs of swap"), though it could be really cool. And Apache isn't around at all.
|
|
|