OpenVZ Forum


Home » General » Support » [solved] Help Me Understand Please (About Setting Resource Per VE)
[solved] Help Me Understand Please (About Setting Resource Per VE) [message #32914] Tue, 09 September 2008 01:07 Go to next message
latheesan is currently offline  latheesan
Messages: 10
Registered: September 2008
Junior Member
I am trying to set a VPS I created to have the following specs:

1 Ghz Guaranteed CPU (Burstable Up-to 2 Ghz)
512 MB Guaranteed RAM (No bursting)

Also, is there a way to limit the maximum upload/download speed per VE? E.g. VE xxx can only upload at 256 kb/s and download at 512 kb/s or is this impossible to do? I saw some settings about TCP buffer size, but I didn't quite understand.

P.S. I am not trying to just workout how to set the above, I am trying to learn, so a few extra details on why you set it like that etc would be most appreciated.

[Updated on: Wed, 10 September 2008 09:52] by Moderator

Report message to a moderator

Re: Help Me Understand Please (About Setting Resource Per VE) [message #32918 is a reply to message #32914] Tue, 09 September 2008 03:11 Go to previous messageGo to next message
latheesan is currently offline  latheesan
Messages: 10
Registered: September 2008
Junior Member
I saw in this guide (http://www.linux.com/feature/114214) a "possible" way of setting RAM per VE and so I tried this:

$ vzctl set VEID --vmguarpages $((256 * 512)) --save
$ vzctl set VEID --privvmpages $((256 * 512)) --save

and I checked the configuration like this ...

$ vzcfgvalidate /etc/vz/conf/VEID.conf

and it replies like this ...

Error: limit should be = 9223372036854775807 for vmguarpages (currently, 131072)

This doesn't make any sense... can someone plz shed some light on this?

[Updated on: Tue, 09 September 2008 03:49]

Report message to a moderator

Re: Help Me Understand Please (About Setting Resource Per VE) [message #32923 is a reply to message #32918] Tue, 09 September 2008 06:46 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 533
Registered: January 2006
Location: Moscow, Russia
Senior Member
Hi.

http://wiki.openvz.org/Traffic_shaping_with_tc
i think this is the answer for your question about traffic shaping.
Please, keep in mind that it makes sense to shape only outgoing shaping as what would you do with network packets already received but more than configured limit? Drop? Inefficient.

Quote:

$ vzcfgvalidate /etc/vz/conf/VEID.conf
and it replies like this ...
Error: limit should be = 9223372036854775807 for vmguarpages (currently, 131072)


Well, seems to understand this one needs to check the sources of the vzcfgvalidate. You are welcome to find out the problem. Smile i don't think this is difficult - just need to find the corresponding printf() and check what formula is used to get the printed value.

Good luck!

--
Konstantin


If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
Re: Help Me Understand Please (About Setting Resource Per VE) [message #32933 is a reply to message #32914] Tue, 09 September 2008 14:14 Go to previous message
latheesan is currently offline  latheesan
Messages: 10
Registered: September 2008
Junior Member
So, have I done this right? To set the RAM of my VPS to 512 MB RAM, I do this:

$ vzctl set VEID --vmguarpages $((256 * 512)) --save
$ vzctl set VEID --privvmpages $((256 * 512)) --save

---[ Edit ]---

Okay, never mind, I think I've worked out how to properly set the RAM now. This IS the correct method. I verified it by using this shell script:

#!/bin/bash
#
# http://www.labradordata.ca/home/40
# Revised 02-Feb-2007: include kernel memory (kmemsize) in 'used' calculation
# and show percentages in output.
# 
BEAN=`cat /proc/user_beancounters`
GUAR=`echo "$BEAN" | grep vmguar | awk '{ print $4;}'`
PRIV=`echo "$BEAN" | grep privvm | awk '{ print $2;}'`
KMEM=`echo "$BEAN" | grep kmem | awk '{ print $3;}'`
let TOTL=$GUAR/256
let KMMB=$KMEM/1048576
let PVMB=$PRIV/256
let USED=$KMMB+$PVMB
let FREE=$TOTL-$USED
if [ "$FREE" -gt "0" ]; then
  let UPER=$USED*100/$TOTL
  let FPER=100-$UPER
else
  let UPER="100"
  let FPER="0"
fi
echo "VPS Memory:"
echo "  Total: $TOTL mb  Used: $USED mb (${UPER}%)  Free: $FREE mb (${FPER}%)"

[Updated on: Tue, 09 September 2008 20:40]

Report message to a moderator

Previous Topic: why buffers cached is always 0 in VPS/VE?
Next Topic: Mach auto template creation
Goto Forum:
  


Current Time: Sat Apr 27 09:43:06 GMT 2024

Total time taken to generate the page: 0.03054 seconds