Memory usage [message #2468] |
Thu, 06 April 2006 10:31 |
eugeniopacheco
Messages: 40 Registered: November 2005
|
Member |
|
|
Hi,
I'm a big fan of openvz, I think it's wonderful, but as I'm a newbie at it I don't fully know how it works...
Well... I'm running openvz on a Celeron 3,066 1024MB RAM 160GB HD and it's working fine, but, I used vzsplit -n 10 -f vps.10 and used this config file with vzctl set VPSID --applyconfig vps.10 --save
I'm running only 3 VPS and when I run top on the host it shows this:
Cpu(s): 1.2% us, 0.0% sy, 0.0% ni, 98.8% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 1025084k total, 1002164k used, 22920k free, 95024k buffers
Is it supposed to look like that? To have the memory all used up like that? Does openvz by default use the entire memory and then split into the VPS's? Is that how it works?
Here's what my vzmemcheck shows:
[root@t248 ~]# vzmemcheck
Output values in %
LowMem LowMem RAM MemSwap MemSwap Alloc Alloc Alloc
util commit util util commit util commit limit
0.81 28.58 5.57 5.57 28.04 23.29 28.04 124.97
[root@t248 ~]# vzmemcheck -A
Output values in Mbytes
LowMem LowMem RAM MemSwap MemSwap Alloc Alloc Alloc
util commit util util commit util commit limit
2.63 93.45 55.74 55.74 280.68 233.10 280.68 1251.05
326.00 326.00 1001.00 1001.00 1001.00 1001.00 1001.00 1001.00
[root@t248 ~]# vzmemcheck -Av
Output values in Mbytes
veid LowMem LowMem RAM MemSwap MemSwap Alloc Alloc Alloc
util commit util util commit util commit limit
101 2.15 24.79 49.62 49.62 87.20 199.25 87.20 358.57
104 0.28 34.33 3.92 3.92 96.74 30.81 96.74 446.24
105 0.21 34.33 2.21 2.21 96.74 3.05 96.74 446.24
------------------------------------------------------------ -------------
Summary: 2.63 93.45 55.74 55.74 280.68 233.10 280.68 1251.05
326.00 326.00 1001.00 1001.00 1001.00 1001.00 1001.00 1001.00
[root@t248 ~]# vzmemcheck -v
Output values in %
veid LowMem LowMem RAM MemSwap MemSwap Alloc Alloc Alloc
util commit util util commit util commit limit
101 0.66 7.58 4.96 4.96 8.71 19.90 8.71 35.82
104 0.09 10.50 0.39 0.39 9.66 3.08 9.66 44.58
105 0.06 10.50 0.22 0.22 9.66 0.30 9.66 44.58
------------------------------------------------------------ -------------
Summary: 0.81 28.58 5.57 5.57 28.04 23.29 28.04 124.97
I read the User manual and it says that if any of these numbers is over 1 it's a problem with configuration... Here's what my vps.10 config template looks like:
# Configuration file generated by vzsplit for 10 VPS
# on HN with total amount of physical mem 1001 Mb
# low memory 817 Mb, swap size 0 Mb, Max treads 8000
# Resourse commit level 0:
# Free resource distribution. Any parameters may be increased
# Primary parameters
NUMPROC="800:800"
AVNUMPROC="209:209"
NUMTCPSOCK="800:800"
NUMOTHERSOCK="800:800"
VMGUARPAGES="15977:2147483647"
# Secondary parameters
KMEMSIZE="17141514:18855665"
TCPSNDBUF="2437038:5713838"
TCPRCVBUF="2437038:5713838"
OTHERSOCKBUF="1218519:4495319"
DGRAMRCVBUF="1218519:1218519"
OOMGUARPAGES="15977:2147483647"
PRIVVMPAGES="95862:105448"
# Auxiliary parameters
LOCKEDPAGES="836:836"
SHMPAGES="9586:9586"
PHYSPAGES="0:2147483647"
NUMFILE="6688:6688"
NUMFLOCK="668:734"
NUMPTY="80:80"
NUMSIGINFO="1024:1024"
DCACHESIZE="3740085:3852288"
NUMIPTENT="200:200"
DISKSPACE="5242880:6242880"
DISKINODES="593396:622736"
CPUUNITS="13738"
Is this all right?
Also, here is what vzcpucheck looks like:
[root@t248 vz-scripts]# vzcpucheck
Current CPU utilization: 42664
Power of the node: 151267
I haven't got any shortage on memory, but I'm affraid that if I run more stuff on the VPS's or if I add more VPS's then I'm gonna get memory shortage... By the way, what's the configuration for RAM memory limitation? Is it oomguarpages or vmguarpages? I read the user manual and I believe it's one of these...
Regards and thanks for having such a wonderful software for free:)
|
|
|
Re: Memory usage [message #2526 is a reply to message #2468] |
Sat, 08 April 2006 19:17 |
dev
Messages: 1693 Registered: September 2005 Location: Moscow
|
Senior Member |
|
|
eugeniopacheco, thanks a lot for such a detailed information, it really helps and wish all the users were doing so!
AFAICS, from your message this line makes you worry:
Mem: 1025084k total, 1002164k used, 22920k free, 95024k buffers
correct?
It is fully ok. This _doesn't_ mean, that memory is used by VPSs or its processes. Most likely your memory is used for caches. You can check this in cat /proc/meminfo output.
Kernel dynamically uses memory for disk caches, so "free" memory is _totally_ unused memory (22Mb in your case), while "used" memory includes caches which are reclaimed when needed automatically.
Now about UBC settings. oomguarpages and vmguarpages are _guarantees_, not limits. oomguarpages guarantees that Out-Of-Memory killer won't try to kill processes in the VPS if it uses less than guaranteed memory pages. vmguarpages guarantees that OS will allow VPS to mmap such amount of private pages.
And the limit your are looking for is 'privvmpages' I think.
|
|
|
|
Re: Memory usage [message #2594 is a reply to message #2589] |
Mon, 10 April 2006 22:04 |
eugeniopacheco
Messages: 40 Registered: November 2005
|
Member |
|
|
Hello again,
I was reading the user manual for OpenVZ and I read that the Alloc Memory is a Virtual memory, so theoretically it shouldn't have a limitation right?
Let me rephrase that... I meant that the total shouldn't have a limit, right? I noticed that the privvmpages limits this Alloc limit... Currently my vzmemcheck shows the following:
[root@t248 ~]# vzmemcheck -Av
Output values in Mbytes
veid LowMem LowMem RAM MemSwap MemSwap Alloc Alloc Alloc
util commit util util commit util commit limit
101 2.49 34.33 62.55 62.55 96.74 212.12 96.74 368.11
102 0.25 24.79 7.15 7.15 87.20 8.57 87.20 436.70
104 2.89 24.79 42.45 42.45 87.20 355.48 87.20 436.70
105 0.21 24.79 2.21 2.21 87.20 3.05 87.20 436.70
------------------------------------------------------------ -------------
Summary: 5.84 108.71 114.36 114.36 358.35 579.21 358.35 1678.21
326.00 326.00 1001.00 1001.00 1001.00 1001.00 1001.00 1001.00
[root@t248 ~]# vzmemcheck -v
Output values in %
veid LowMem LowMem RAM MemSwap MemSwap Alloc Alloc Alloc
util commit util util commit util commit limit
101 0.76 10.50 6.25 6.25 9.66 21.19 9.66 36.77
102 0.08 7.58 0.71 0.71 8.71 0.86 8.71 43.62
104 0.89 7.58 4.24 4.24 8.71 35.51 8.71 43.62
105 0.06 7.58 0.22 0.22 8.71 0.30 8.71 43.62
------------------------------------------------------------ -------------
Summary: 1.79 33.25 11.42 11.42 35.80 57.86 35.80 167.64
The question is, is the 1001.00 the maximum that should be used? I mean, take a look at the vzmemcheck -Av, it shows that the sum is actually 1678,21, but it shows underneath that number, 1001,00. But the RAM is still unused... It's only using 114,36 MB of RAM, so I can make privvmpages larger, without problems, even though it sums over the 1001,00, right?
Regards, and again thanks for all your help;)
|
|
|
|
|
|