OpenVZ Forum


Home » General » Support » Allocate more RAM to a VPS
Allocate more RAM to a VPS [message #37304] Wed, 02 September 2009 09:45 Go to next message
dragos2 is currently offline  dragos2
Messages: 15
Registered: August 2009
Junior Member
I would like to allocate more RAM memory to my vps.

Can I allocate more than 800 MB to a vps ? How ?

Thank you
Re: Allocate more RAM to a VPS [message #37306 is a reply to message #37304] Wed, 02 September 2009 11:57 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

http://wiki.openvz.org/Category:UBC

Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Allocate more RAM to a VPS [message #37307 is a reply to message #37306] Wed, 02 September 2009 12:47 Go to previous messageGo to next message
dragos2 is currently offline  dragos2
Messages: 15
Registered: August 2009
Junior Member
kir wrote on Wed, 02 September 2009 14:57
http://wiki.openvz.org/Category:UBC


Thanks

So what I need is physpages, how big is a ram page ?

For example if I want to allocate 512 MB of RAM how can
I use this:

vzctl set 101 --physpages 512 --save


?
Re: Allocate more RAM to a VPS [message #37311 is a reply to message #37304] Wed, 02 September 2009 14:20 Go to previous messageGo to next message
divB is currently offline  divB
Messages: 79
Registered: April 2009
Member
No.

1.) size of a page is dependent on architecture, with i386 usually 4096 bytes
2.) This is an auxiliary parameter, not a primary one! You should look instead to oomguarpages, privvmpages.
3.) You need to learn very much! Start with http://maxgarrick.com/understanding-openvz-resource-limits/ and then read everything in the link above in the Wiki. Resource management in OpenVZ is very, very complex! And not easy! You need to know how memory management on i386 and Linux works. Otherwise the chance is high to break your configuration leading to unstable system, system hangs and errors which you can't understand.
4.) It's also too complex for me, so I used the following way:
http://forum.openvz.org/index.php?t=tree&goto=37293& #msg_37293
5.) If you change a value, I recommend to validate with vzcfgvalidate (which implements the complex formulas in http://wiki.openvz.org/UBC_consistency_check)

Regards,
divB

Re: Allocate more RAM to a VPS [message #37328 is a reply to message #37304] Thu, 03 September 2009 08:32 Go to previous messageGo to next message
dragos2 is currently offline  dragos2
Messages: 15
Registered: August 2009
Junior Member
It seems that memory is shared. Now I understand that a container
is different in this way compared with traditional virtualization.

But it seems that some companies wants to implement this shared
memory model in order to increase the vm density.

Back to my question.

It is an Ubuntu Server 8.04 LTS 64 bit with 4 GB of RAM
root@ubu01:~# free -m
             total       used       free     shared    buffers     cached
Mem:          3954       3813        140          0        328       2976
-/+ buffers/cache:        508       3445
Swap:         7632         46       7585

root@ubu01:~# vzlist
      VEID      NPROC STATUS  IP_ADDR         HOSTNAME
       777         27 running 192.168.1.1     vps1
       778         24 running 192.168.2.1     vps2


root@ubu01:~# vzcpucheck
Current CPU utilization: 3000
Power of the node: 281530


778 is a default centos5 32 bit template using 256 MB of ram

But 777 is the one that I am interested in with, it is
an Ubuntu 8.04 64 bit default template running a webserver.

I would like to double its memory from 256MB to 512MB
considering all the aspects of the default template.

Can you please give me an example of how to do this?

Thank you
Re: Allocate more RAM to a VPS [message #37333 is a reply to message #37328] Thu, 03 September 2009 12:02 Go to previous messageGo to next message
divB is currently offline  divB
Messages: 79
Registered: April 2009
Member
1.) Are you sure the memory is sharedß In what way? Where did you read this?

IMO the memory between containers can ONLY be shared when the program/library images (files) point to the same file. Only then the Linux kernel can see that the code is the same and share the memory (this is done in Linux without virtualization). But if there are two different apach2 ELF files in different containers the Kernel can't say that these two are identical and loads both of them.

2.) No, I can't. Read my posting. Without guarantee, I would just scale the 256MB container with 2 in order to get a 512 container as described in http://wiki.openvz.org/Intermediate_UBC_configurations.

Maybe another way: 512MB = 536870912 Bytes / 4096 = 131072 Pages. Set vmguarpages to this value ans run vzcfgvalidate. Again: Without guarantee. Read the Wiki!!

Re: Allocate more RAM to a VPS [message #37334 is a reply to message #37333] Thu, 03 September 2009 12:22 Go to previous messageGo to next message
dragos2 is currently offline  dragos2
Messages: 15
Registered: August 2009
Junior Member
This link helps, thank you
http://wiki.openvz.org/UBC_derived_configuration_examples

The only hard thing to do correctly now in OpenVz is correct
memory allocation to containers.

Maybe in future releases this will be little more inteligible.

Are there vps.large vps.extralarge os template configurations ?

[Updated on: Thu, 03 September 2009 12:23]

Report message to a moderator

Re: Allocate more RAM to a VPS [message #37335 is a reply to message #37334] Thu, 03 September 2009 13:07 Go to previous messageGo to next message
divB is currently offline  divB
Messages: 79
Registered: April 2009
Member
No, but the manuel says that you should create large and extralarge configurations with scaling.
Re: Allocate more RAM to a VPS [message #37336 is a reply to message #37335] Thu, 03 September 2009 13:21 Go to previous message
dragos2 is currently offline  dragos2
Messages: 15
Registered: August 2009
Junior Member
divB wrote on Thu, 03 September 2009 16:07
No, but the manuel says that you should create large and extralarge configurations with scaling.


Scaling or vzsplit seems to be the best choices.

Thanks
Previous Topic: sock_sendpage() kernel vulnerability
Next Topic: Calculating kmemsize
Goto Forum:
  


Current Time: Thu Mar 28 13:58:05 GMT 2024

Total time taken to generate the page: 0.01773 seconds