Memory Allocation [message #34356] |
Wed, 24 December 2008 16:28 |
zoom
Messages: 19 Registered: March 2006 Location: Regina, Saskatchewan Cana...
|
Junior Member |
|
|
I have a general question concerning memory allocation. I have a VPS setup to have 256MB guaranteed and 512MB burst, however when I do "free -m" within the container the total memory shown is 512MB? Should it be 256MB?
total used free
Mem: 512 132 379
-/+ buffers/cache: 132 379
Swap: 0 0 0
Below are my container settings for memory based on a 64 bit host.
PRIVVMPAGES="131072:144384"
VMGUARPAGES="65536:9223372036854775807"
OOMGUARPAGES="65536:9223372036854775807"
|
|
|
|
Re: Memory Allocation [message #35244 is a reply to message #34359] |
Wed, 11 March 2009 19:32 |
techdruid
Messages: 3 Registered: March 2009
|
Junior Member |
|
|
I have encountered this same problem.
I tried changing vzctl --meminfo in various ways. However, no matter how I set this, the free command and cat /proc/meminfo always show the full amount of memory from the host/hardware system.
Any advice would greatly appreciated.
/proc/users_beancounters
resource held maxheld barrier limit
kmemsize 1055739 1341307 16384000 18022400
privvmpages 11036 11759 262144 292912
shmpages 31 31 131072 131072
physpages 2150 2631 0 2147483647
vmguarpages 0 0 102400 102400
oomguarpages 2150 2631 102400 102400
I've tried
# vzctl set 1 --meminfo privvmpages:1 --save
# vzctl set 1 --meminfo pages:292912 --save
Tried restarting the container stop/start, but I continue to see the following in the container from # free -m
total used free shared buffers cached
1009 45 964 0 0 0
-/+ b/c: 45 964
Swap:
0 0 0
Amended. I should point out that I'm using the values defined on this page here.
http://wiki.openvz.org/UBC_configuration_examples_table
Idea's / Thoughts?
Thanks in advance
Richard
[Updated on: Wed, 11 March 2009 19:38] Report message to a moderator
|
|
|
Re: Memory Allocation [message #35245 is a reply to message #35244] |
Wed, 11 March 2009 20:32 |
techdruid
Messages: 3 Registered: March 2009
|
Junior Member |
|
|
It would appear that my mistake here is that I was setting the meminfo value too high. I was assuming this was bytes and not pages.
Correct command for 256MB RAM is...
# vzctl set <veid> --meminfo pages:65536 --save
It would seem to me that this page below is incorrect though. It explains that for 248MB of RAM, you should set privvmpages to 262,144 / 292,912 . However, this results in over 1GB of total RAM on the container. Shouldn't this example be closer to 65536?
http://wiki.openvz.org/UBC_configuration_examples_table
Or am I missing something?
Richard
[Updated on: Wed, 11 March 2009 20:33] Report message to a moderator
|
|
|
Re: Memory Allocation [message #43570 is a reply to message #34356] |
Mon, 26 September 2011 11:44 |
Rene
Messages: 40 Registered: September 2006
|
Member |
|
|
Where is --meminfo documented? If I hit vzctl --help it's not listed as an option, nor is it explained in the man page....
# vzctl --help
vzctl version 3.0.29.2
Copyright (C) 2000-2010, Parallels, Inc.
This program may be distributed under the terms of the GNU GPL License.
Usage: vzctl [options] <command> <ctid> [parameters]
vzctl create <ctid> [--ostemplate <name>] [--config <name>]
[--private <path>] [--root <path>] [--ipadd <addr>] | [--hostname <name>]
vzctl start <ctid> [--force] [--wait]
vzctl destroy | mount | umount | stop | restart | status <ctid>
vzctl quotaon | quotaoff | quotainit <ctid>
vzctl enter <ctid> [--exec <command> [arg ...]]
vzctl exec | exec2 <ctid> <command> [arg ...]
vzctl runscript <ctid> <script>
vzctl chkpnt <ctid> [--dumpfile <name>]
vzctl restore <ctid> [--dumpfile <name>]
vzctl set <ctid> [--save] [--force] [--setmode restart|ignore]
[--ipadd <addr>] [--ipdel <addr>|all] [--hostname <name>]
[--nameserver <addr>] [--searchdomain <name>]
[--onboot yes|no] [--bootorder <N>]
[--userpasswd <user>:<passwd>]
[--cpuunits <N>] [--cpulimit <N>] [--cpus <N>] [--cpumask <cpus>]
[--diskspace <soft>[:<hard>]] [--diskinodes <soft>[:<hard>]]
[--quotatime <N>] [--quotaugidlimit <N>]
[--noatime yes|no] [--capability <name>:on|off ...]
[--devices b|c:major:minor|all:r|w|rw]
[--devnodes device:r|w|rw|none]
[--netif_add <ifname[,mac,host_ifname,host_mac,bridge]]>]
[--netif_del <ifname>]
[--applyconfig <name>] [--applyconfig_map <name>]
[--features <name:on|off>] [--name <vename>] [--ioprio <N>]
[--pci_add [<domain>:]<bus>:<slot>.<func>] [--pci_del <d:b:s.f>]
[--iptables <name>] [--disabled <yes|no>]
[UBC parameters]
UBC parameters (N - items, P - pages, B - bytes):
Two numbers divided by colon means barrier:limit.
In case the limit is not given it is set to the same value as the barrier.
--numproc N[:N] --numtcpsock N[:N] --numothersock N[:N]
--vmguarpages P[:P] --kmemsize B[:B] --tcpsndbuf B[:B]
--tcprcvbuf B[:B] --othersockbuf B[:B] --dgramrcvbuf B[:B]
--oomguarpages P[:P] --lockedpages P[:P] --privvmpages P[:P]
--shmpages P[:P] --numfile N[:N] --numflock N[:N]
--numpty N[:N] --numsiginfo N[:N] --dcachesize N[:N]
--numiptent N[:N] --physpages P[:P] --avnumproc N[:N]
--swappages P[:P]
It's not like it's not recognized though:
# vzctl set 1402 --meminfo
vzctl: option `--meminfo' requires an argument
|
|
|