[solved] Help Me Understand Please (About Setting Resource Per VE) [message #32914] |
Tue, 09 September 2008 01:07 |
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 #32933 is a reply to message #32914] |
Tue, 09 September 2008 14:14 |
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
|
|
|