OpenVZ Forum


Home » Mailing lists » Users » setting memory allocation
setting memory allocation [message #12531] Wed, 02 May 2007 08:25 Go to next message
Markus Hardiyanto is currently offline  Markus Hardiyanto
Messages: 27
Registered: April 2007
Junior Member
Hello,

I have a computer with P4 2,4Ghz processor and 1GB of RAM. I'm planning to split it into 3 VEs with this memory allocation:
VE1: 512MB
VE2: 256MB
VE3: 256MB

as I understand openvz allow a VE to use RAM more than the amount allocated to a VE, so I want the VEs able to use RAM upto:
VE1: 768MB
VE2: 384MB
VE3 384MB

how to set this? what configuration I must change? kmemsize? privvmpages?

thanks

Best Regards,
Markus



Send instant messages to your online friends http://uk.messenger.yahoo.com
Re: setting memory allocation [message #12553 is a reply to message #12531] Wed, 02 May 2007 14:46 Go to previous messageGo to next message
Gregor Mosheh is currently offline  Gregor Mosheh
Messages: 62
Registered: April 2007
Member
I'd like to take a shot at answering this, to "quiz myself" on how well I
understand this stuff. So if my answers are incorrect or incomplete,
please speak up!

> I have a computer with P4 2,4Ghz processor and 1GB of RAM. I'm planning to
> split it into 3 VEs with this memory allocation:
> VE1: 512MB
> VE2: 256MB
> VE3: 256MB

If by "memory allocation" you mean "the amount of RAM they're guaranteed
to have available for use by apps" then try this:

# RAM is 4k pages, so 131072*4k = 512M
vzctl set 1 --save --vmguarpages 131072
vzctl set 1 --save --oomguarpages 131072
vzctl set 1 --save --privvmpages 131072:196608

But, if you really have only 1 GB of RAM, it may not be wise to allocate
all of it. If all of the VEs really use all their RAM, the system will
start swapping to make up more RAM (e.g. for the HN's own use) and nobody
enjoys a system that's swapping.

-Gregor
Re: setting memory allocation [message #12567 is a reply to message #12531] Thu, 03 May 2007 03:05 Go to previous messageGo to next message
Markus Hardiyanto is currently offline  Markus Hardiyanto
Messages: 27
Registered: April 2007
Junior Member
# RAM is 4k pages, so 131072*4k = 512M
vzctl set 1 --save --vmguarpages 131072
vzctl set 1 --save --oomguarpages 131072
vzctl set 1 --save --privvmpages 131072:196608

i thought all the numbers in beancounters was in bytes.. so why you divided it with 4k?
Best Regards,
Markus

----- Original Message ----
From: Gregor Mosheh <gregor@hostgis.com>
To: users@openvz.org
Sent: Wednesday, May 2, 2007 9:46:52 PM
Subject: Re: [Users] setting memory allocation

I'd like to take a shot at answering this, to "quiz myself" on how well I
understand this stuff. So if my answers are incorrect or incomplete,
please speak up!

> I have a computer with P4 2,4Ghz processor and 1GB of RAM. I'm planning to
> split it into 3 VEs with this memory allocation:
> VE1: 512MB
> VE2: 256MB
> VE3: 256MB

If by "memory allocation" you mean "the amount of RAM they're guaranteed
to have available for use by apps" then try this:

# RAM is 4k pages, so 131072*4k = 512M
vzctl set 1 --save --vmguarpages 131072
vzctl set 1 --save --oomguarpages 131072
vzctl set 1 --save --privvmpages 131072:196608

But, if you really have only 1 GB of RAM, it may not be wise to allocate
all of it. If all of the VEs really use all their RAM, the system will
start swapping to make up more RAM (e.g. for the HN's own use) and nobody
enjoys a system that's swapping.

-Gregor

Send instant messages to your online friends http://uk.messenger.yahoo.com
Re: setting memory allocation [message #12568 is a reply to message #12567] Thu, 03 May 2007 04:23 Go to previous messageGo to next message
Cranky is currently offline  Cranky
Messages: 14
Registered: September 2005
Location: Manchester, UK
Junior Member

On x86 and x86-64 systems pages are measured in 4k - OVZ uses this these pages
for resource allocation.

I believe you can also use M and G suffixes on recent OVZ package releases to
set privvmpages/oomguarpages/vmguarpages. For example, "vzctl set $veid
--vmguarpages 512M:600M" will translate to 131072:153600 (barrier:limit) pages
automatically so you don't need to do to the math.

Regards,

Andrew Cranson
Layershift Limited
www.layershift.com

ICQ: 161813538
MSN: andrew@transnexis.com
AIM: cransona

>>> Virtuozzo Virtual Private Servers now available from $12.95/mo (US-based)
or 10.95/mo (UK-based)! Ask me for details. <<<

Layershift Limited is a company registered in England and Wales.
Company number: 6036217
EU VAT number: (application in progress)

Correspondence Address:
Layershift Limited, PO Box 222, Manchester, M12 5WB

Registered Office (please do not use for surface mail):
Layershift Limited, c/o Cranleys Chartered Accountants
24 Finns Business Park, Mill Lane, Crondall, Farnham, Surrey, GU10 5RX

Markus Hardiyanto wrote:
> # RAM is 4k pages, so 131072*4k = 512M
> vzctl set 1 --save --vmguarpages 131072
> vzctl set 1 --save --oomguarpages 131072
> vzctl set 1 --save --privvmpages 131072:196608
>
> i thought all the numbers in beancounters was in bytes.. so why you divided it with 4k?
> Best Regards,
> Markus
>
> ----- Original Message ----
> From: Gregor Mosheh <gregor@hostgis.com>
> To: users@openvz.org
> Sent: Wednesday, May 2, 2007 9:46:52 PM
> Subject: Re: [Users] setting memory allocation
>
> I'd like to take a shot at answering this, to "quiz myself" on how well I
> understand this stuff. So if my answers are incorrect or incomplete,
> please speak up!
>
>> I have a computer with P4 2,4Ghz processor and 1GB of RAM. I'm planning to
>> split it into 3 VEs with this memory allocation:
>> VE1: 512MB
>> VE2: 256MB
>> VE3: 256MB
>
> If by "memory allocation" you mean "the amount of RAM they're guaranteed
> to have available for use by apps" then try this:
>
> # RAM is 4k pages, so 131072*4k = 512M
> vzctl set 1 --save --vmguarpages 131072
> vzctl set 1 --save --oomguarpages 131072
> vzctl set 1 --save --privvmpages 131072:196608
>
> But, if you really have only 1 GB of RAM, it may not be wise to allocate
> all of it. If all of the VEs really use all their RAM, the system will
> start swapping to make up more RAM (e.g. for the HN's own use) and nobody
> enjoys a system that's swapping.
>
> -Gregor
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
Re: setting memory allocation [message #12569 is a reply to message #12568] Thu, 03 May 2007 04:30 Go to previous messageGo to next message
Gregor Mosheh is currently offline  Gregor Mosheh
Messages: 62
Registered: April 2007
Member
Andrew Cranson (Layershift Limited) wrote:
> I believe you can also use M and G
> suffixes on recent OVZ package releases

Good to hear someone else saying this; I wondered if I was just crazy for
thinking M and G, that I'm imagined seeing them somewhere. ;)

On my very-outdated test system for my initial experiments, those didn't
work at all. But I'd love to see it work using a modern version of OpenVZ
on modern hardware. :)


-gregor
Re: setting memory allocation [message #12576 is a reply to message #12567] Thu, 03 May 2007 09:06 Go to previous message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Markus Hardiyanto wrote:
> # RAM is 4k pages, so 131072*4k = 512M
> vzctl set 1 --save --vmguarpages 131072
> vzctl set 1 --save --oomguarpages 131072
> vzctl set 1 --save --privvmpages 131072:196608
>
> i thought all the numbers in beancounters was in bytes.. so why you divided it with 4k?
>

Those UBC params that end in -pages are measured in pages.
For more details, see
http://wiki.openvz.org/UBC_parameter_units
http://wiki.openvz.org/Memory_page
Previous Topic: How-to setup OpenVZ on openSUSE ?
Next Topic: trouble booting with FC6-64
Goto Forum:
  


Current Time: Wed Feb 21 01:14:15 GMT 2024

Total time taken to generate the page: 0.03087 seconds