Results 1 to 21 of 21
Thread: Guarantied memory on OpenVZ
-
10-31-2009, 10:05 AM #1Aspiring Evangelist
- Join Date
- Sep 2007
- Posts
- 436
Guarantied memory on OpenVZ
How I can see how much guaranteed memory I have ? And how I can see how much guaranteed memory I have used ?
Additional how I can see how much bustable memory I have used or how much total memory my VPS is using.
-
10-31-2009, 10:26 AM #2Disabled
- Join Date
- Sep 2004
- Location
- India
- Posts
- 222
Login to your VPS using SSH and use the command " top " it will show you how much RAM are you allowed.
However it doesn't differentiate guaranteed and busted RAM.
-
10-31-2009, 10:34 AM #3Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
Try this.
To view burst RAM:
free -m
To view Guaranteed RAM, Used & Free
Create a new script called Free
nano /root/Free
Paste the following inside:
#!/bin/bash
#
# 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}%)"
Type in Free
This will give you a nice output like:
VPS Memory:
Total: 768 mb Used: 412 mb (53%) Free: 356 mb (47%)
That is your guaranteed RAM
Script comes from http://www.labradordata.ca/home/40
-
10-31-2009, 12:33 PM #4New Member
- Join Date
- Mar 2009
- Posts
- 3
Thank you chris for the script, i used the script from that page to show me that VAServe/FSCKVPS had been setting my ressources incorrectly.
edit: Also top and free -m, shows a different value to that of the beancounter file, 512 for top/free -m and 256MB in beancounter (i've read elsewhere that you had to look in beancounter for the right stats, but i've been unable to interpret the data until now), so top/free -m isn't showing the real stats.Last edited by Rune TM; 10-31-2009 at 12:38 PM.
-
10-31-2009, 12:53 PM #5Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
A modern OpenVZ system will show your burst ram with "free" or "free -m"
If it shows anything else i.e. the RAM of the host, then your provider is running a very old version of OpenVZ.
-
10-31-2009, 12:58 PM #6Aspiring Evangelist
- Join Date
- Sep 2007
- Posts
- 436
Do i need to reboot my VPS ?!
it`s not working for me.
-
10-31-2009, 02:14 PM #7Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
SHouldnt do, what error are you getting?
-
10-31-2009, 02:22 PM #8Newbie
- Join Date
- Oct 2009
- Posts
- 6
-
10-31-2009, 02:39 PM #9Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
Might be worth sticking it in /bin infact so you can run it from anywhere
-
10-31-2009, 02:39 PM #10New Member
- Join Date
- Mar 2009
- Posts
- 3
Sumi, i followed the specifications in chris' link rather than what he typed, you could try that instead.
The page notes that you have to be using the root account, else it wont work. it does specify a way to get around it.
-
10-31-2009, 02:44 PM #11Aspiring Evangelist
- Join Date
- Sep 2007
- Posts
- 436
I did not type ./ Sorry
and Here are the results:
VPS Memory:
Total: 512 mb Used: 719 mb (100%) Free: -207 mb (0%)
and this is empty VPSLast edited by sumi; 10-31-2009 at 02:50 PM.
-
10-31-2009, 02:46 PM #12Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 3,110
Are you sure its empty?
You are in a - value because you are using 407MB of burstable ram in addition to your guaranteed.
Either that or the script doesn't like your server. I've been using it for years and years though without any problems.
-
10-31-2009, 02:53 PM #13Aspiring Evangelist
- Join Date
- Sep 2007
- Posts
- 436
Yes,
It has bean setup yesterday.
noting on the server. just Cpanel installation.
-
10-31-2009, 07:54 PM #14Web Hosting Master
- Join Date
- Dec 2004
- Location
- Butler,TN
- Posts
- 2,416
Hi!
Do this:
cd out of root and type this:
cat proc_user_beancoumters
Post here and I'll decipher.Bryon L Harvey
Soil Relocation Engineer
-
10-31-2009, 08:10 PM #15Aspiring Evangelist
- Join Date
- Sep 2007
- Posts
- 436
Here is in the attachment
-
11-01-2009, 06:59 AM #16Web Hosting Master
- Join Date
- Dec 2004
- Location
- Butler,TN
- Posts
- 2,416
Hi!
Ok..you have:
131080/131080 in Vmguarpages. This is your "guaranteed RAM"=512MB
500000/750000 in Privvmpages. This is burst RAM=1953MB/2929Mb
Kernel RAM allocations are 58.84MB/118.43MB..which is fine.Bryon L Harvey
Soil Relocation Engineer
-
11-01-2009, 07:30 AM #17Aspiring Evangelist
- Join Date
- Sep 2007
- Posts
- 436
Thanks.
how i can see how much guaranteed RAM memory i use at this moment ?
-
11-01-2009, 08:49 AM #18Web Hosting Master
- Join Date
- Dec 2004
- Location
- Butler,TN
- Posts
- 2,416
Hi!
Look at the oomjuarpages number..that accounts for current RAM + SWAP used.
In this case..35097.which is 35097 4K pages..or 140MB..approximately.
>>>It should be pointed out nodes can be overallocated..sometimes horribly.
In this case..you are going to have a hard time using even part of what you were "guaranteed".Bryon L Harvey
Soil Relocation Engineer
-
11-01-2009, 05:23 PM #19Retired Moderator
- Join Date
- Feb 2005
- Location
- Australia
- Posts
- 5,849
Absolutely. And whether the node is overallocated or not, your actual (the wonderfully-misnamed "guaranteed") memory usage can still be drastically constrained by the other limits, notably kmemsize and burst. Some providers are even setting guaranteed=burst - the only thing guaranteed there is that you'll never be able to use the guaranteed memory...
sumi - that's a well set-up VPS. You're in luck.Chris
"Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter
-
11-01-2009, 05:39 PM #20Aspiring Evangelist
- Join Date
- Sep 2007
- Posts
- 436
-
11-01-2009, 06:00 PM #21Retired Moderator
- Join Date
- Feb 2005
- Location
- Australia
- Posts
- 5,849
Based on the beancounters file, it's good. Of course that doesn't eliminate the possibility of other problems (overcommitment, limited i/o etc) but it's a good start.
Chris
"Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter
Similar Threads
-
Apache on OpenVZ VPS uses all memory
By Abu Mami in forum Hosting Security and TechnologyReplies: 6Last Post: 07-12-2011, 10:41 AM -
How to reduce OpenVZ memory usage by >50%
By cieslakd in forum Hosting Security and TechnologyReplies: 4Last Post: 10-08-2010, 06:53 AM -
How to limit memory for VE on openvz
By admrootlinux in forum VPS HostingReplies: 12Last Post: 10-31-2008, 03:18 AM -
OpenVZ with 256 ram assigned, Plesk errors and vps memory full
By Hostenlinea in forum Hosting Security and TechnologyReplies: 2Last Post: 10-21-2008, 07:43 PM -
OpenVZ burstable memory
By SysAdminMan in forum VPS HostingReplies: 13Last Post: 12-05-2007, 10:36 PM