OpenVZ Forum


Home » General » Support » RAM and Swap misconfigured? :S
icon9.gif  RAM and Swap misconfigured? :S [message #27082] Fri, 08 February 2008 14:08 Go to next message
silentninja is currently offline  silentninja
Messages: 37
Registered: September 2007
Member
I've noticed that on our VPS server which has 2gb of ram and 4gb of swap memory, it seems to give unlimited ram memory to all vps.. or maybe I am wrong.

Here's the 97.conf file options (where 97 is the ID from a vps):

VERSION="2"
ONBOOT="yes"

NUMPROC="400"
NUMTCPSOCK="500"
NUMOTHERSOCK="500"
VMGUARPAGES="102400"
KMEMSIZE="16384000:18022400"
TCPSNDBUF="5365760:10485760"
TCPRCVBUF="5365760:10485760"
OTHERSOCKBUF="1503232:4063232"
DGRAMRCVBUF="262144"
OOMGUARPAGES="102400"
LOCKEDPAGES="4096"
SHMPAGES="131072"
PRIVVMPAGES="262144:292912"
NUMFILE="8192"
NUMFLOCK="200:220"
NUMPTY="64"
NUMSIGINFO="512"
DCACHESIZE="4194304:4317184"
PHYSPAGES="9223372036854775807"
NUMIPTENT="300"

DISKSPACE="20000000:25000000"
DISKINODES="7000000:7200000"
QUOTATIME="0"

OFFLINE_MANAGEMENT="yes"
VE_ROOT="/vz/root/$VEID"
VE_PRIVATE="/vz/private/$VEID"
OSTEMPLATE="centos-4-i386-default"
ORIGIN_SAMPLE="vps.basic"
IP_ADDRESS="xxx.xxx.xxx.xxx"
CPULIMIT="21"
QUOTAUGIDLIMIT="1000"
HOSTNAME="xxx.xxxxxxxx.xxx"


(I've edited the HOSTNAME and IP_ADDRESS for privacy, all other stuff has been copypasted).

My Idea is that the VPS has about 256mb of total RAM and some Swap too (ideally 512mb, but i don't know if it's ok on the conf).

Although if you enter the vps and execute a "top" command, it still shows you 2gb of ram and 4gb of swap.. it's like it's not being limited properly, although if I give the vps less memory it shows me a fork issue, so it seems to work.. mostly.

Is there any way to fix this so the TOP shows me only the ram and swap assigned, and also, is my conf file ok to limit my server to 256mb ram and 512mb swap?

[Updated on: Fri, 08 February 2008 14:11]

Report message to a moderator

Re: RAM and Swap misconfigured? :S [message #27110 is a reply to message #27082] Sat, 09 February 2008 22:02 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

Quote:

limit my server to 256mb ram and 512mb swap

actually you cannot divide virtual memory which is assigned to VE among SWAP and ram. Please look at
http://forum.openvz.org/index.php?t=msg&goto=24436&& amp;srch=swap+inside+VE#msg_24436

Quote:

Is there any way to fix this so the TOP shows me only the ram

May be the reason is "meminfo" parameter? Please see "man vzctl"
Re: RAM and Swap misconfigured? :S [message #27111 is a reply to message #27110] Sat, 09 February 2008 22:12 Go to previous messageGo to next message
silentninja is currently offline  silentninja
Messages: 37
Registered: September 2007
Member
maratrus wrote on Sat, 09 February 2008 19:02


May be the reason is "meminfo" parameter? Please see "man vzctl"



Ok, I've understood your first comment about the swap memory, although I was checking the "man vzctl" page and I didn't understood really what you meant with meminfo, is there any setting that allows me to show only the 256mb of RAM corresponding to his VE on the top command with the meminfo param.?
Re: RAM and Swap misconfigured? :S [message #27121 is a reply to message #27111] Sun, 10 February 2008 07:21 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

It's just an assumption
from "man vzctl":
Quote:

Memory output parameters
This parameter control output of /proc/meminfo inside a VE
--meminfo none
No /proc/meminfo virtualization (the same as on host system).
--meminfo mode:value
Configure total memory output in a VE. Free memory is evaluated accordingly to the mode being set.
You can use the following modes for mode:
pages:value - sets total memory in pages
privvmpages:value - sets total memory as privvmpages * value

Re: RAM and Swap misconfigured? :S [message #27130 is a reply to message #27121] Sun, 10 February 2008 16:12 Go to previous messageGo to next message
silentninja is currently offline  silentninja
Messages: 37
Registered: September 2007
Member
I've already read that.. I said that I didn't undesrtood what it does.
What should I configure to meminfo.. meminfo=256M ?
Wouldn't it show me 256m / all ram used by all vps? it'd show me always the server using all of the memory available.

[Updated on: Sun, 10 February 2008 16:14]

Report message to a moderator

Re: RAM and Swap misconfigured? :S [message #27159 is a reply to message #27130] Mon, 11 February 2008 13:59 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,
vzctl <CT_ID> set --meminfo privvmpages:1 --save
Re: RAM and Swap misconfigured? :S [message #27170 is a reply to message #27159] Mon, 11 February 2008 16:22 Go to previous messageGo to next message
silentninja is currently offline  silentninja
Messages: 37
Registered: September 2007
Member
maratrus wrote on Mon, 11 February 2008 10:59

Hi,
vzctl <CT_ID> set --meminfo privvmpages:1 --save



The command is wrong, I've done:
vzctl set 97 --meminfo privvmpages:1 --save

And now the top shows me 0k of swap and 1024mb ram. Could it be that the swap pages has been set up for 768mb ?

[Updated on: Mon, 11 February 2008 16:40]

Report message to a moderator

Re: RAM and Swap misconfigured? :S [message #27173 is a reply to message #27170] Mon, 11 February 2008 16:55 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

I'm sorry but I cannot understand you:

Quote:

The command is wrong

Quote:

And now the top shows me 0k of swap and 1024mb ram.


Sure, if PRIVVMPAGES="262144:292912" that values are expected.
Please, look at http://wiki.openvz.org/UBC_parameters
Re: RAM and Swap misconfigured? :S [message #27177 is a reply to message #27173] Mon, 11 February 2008 17:46 Go to previous messageGo to next message
silentninja is currently offline  silentninja
Messages: 37
Registered: September 2007
Member
maratrus wrote on Mon, 11 February 2008 13:55

Sure, if PRIVVMPAGES="262144:292912" that values are expected.
Please, look at http://wiki.openvz.org/UBC_parameters



Oh.. I see, it's pages not bytes xP
Although I've configured my VPS based the third example from the UBC, here: http://wiki.openvz.org/UBC_configuration_examples_table

And it says the server will have 250mb of user memory with that privvmpages on set, is there any reason about it?

[Updated on: Mon, 11 February 2008 17:47]

Report message to a moderator

Re: RAM and Swap misconfigured? :S [message #27338 is a reply to message #27177] Fri, 15 February 2008 09:09 Go to previous message
xemul is currently offline  xemul
Messages: 248
Registered: November 2005
Senior Member
Quote:

the server will have 250mb of user memory with that privvmpages on set, is there any reason about it


privvmpages limit is smth like "beancounter will not block you mmap and brk calls till you hit this limit with your private mappings lengths". In other words - these limits do not
1. provide any guarantee for memory allocation
2. provide a strong limit for the memory consumption of your VE


http://static.openvz.org/userbars/openvz-developer.png
Previous Topic: NFS server on VE
Next Topic: How is the privvmpages limit reached?
Goto Forum:
  


Current Time: Tue Aug 27 19:24:12 GMT 2024

Total time taken to generate the page: 0.03657 seconds