OpenVZ Forum


Home » General » Support » [solved] Help Me Understand Please (About Setting Resource Per VE)
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

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


Current Time: Sun Jul 14 18:46:05 GMT 2024

Total time taken to generate the page: 0.02277 seconds