Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 25, 2012, 09:50:36 AM

Pages: [1]   Go Down
  Print  
Author Topic: How to check memory and CPU usage in VPS?  (Read 996 times)
testall
Intergalactic Cowboy
*****
Offline Offline

Posts: 70


« on: June 03, 2007, 12:26:48 PM »

 Help thanks.
Logged
otseng
Pong! (the videogame) Master
*****
Offline Offline

Posts: 28


« Reply #1 on: June 04, 2007, 06:46:41 AM »

When you ssh into your account, run "top".

Or in Plesk, goto System/Server/System Statistics.
Logged
testall
Intergalactic Cowboy
*****
Offline Offline

Posts: 70


« Reply #2 on: June 04, 2007, 05:52:43 PM »

thanks. i wrote a simple c program to find out.

#include <stdio.h>

main()
{
int *p;
int i;
        for(i=500;i>0;i=i-5) {
                p = (int *)malloc(i*1024000);
                if (p == 0) ;
                else{
                        printf("Free Memory: %d M\n",i);
                        free(p);
                        break;
                }
        }
        return 0;

}
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1395



« Reply #3 on: June 06, 2007, 12:36:59 AM »

Hi testall,

Your way of checking free memory amount looks a bit dangerous because some services may get out of memory during your program run. It would be more safely to check the output of the command below

Code:
cat /proc/user_beancounters

to get the memory usages for your VPS.
Logged

Kind Regards,
Vlad Artamonov
vivalite
Intergalactic Cowboy
*****
Offline Offline

Posts: 52


« Reply #4 on: June 06, 2007, 04:49:12 PM »

I am using a very nice little php script called "vpsinfo" from LabradorData. It shows me everything I care for my VPS. For example oomguarpages, privvmpages, disk usage, network connections, process tree, mysql status and a lot more.

Here is my my vpsinfo page for example: http://www.itamsdemo.com/myvpsinfo/
And here is vpsinfo website: http://www.labradordata.ca/home/13

A little tip on VPS admin: watch close to your privvmpages which is the burstable memory you used. You should always keep this number under 544MB (the VPS resource limit) otherwise your system will hang up!
« Last Edit: June 06, 2007, 04:57:57 PM by vivalite » Logged
testall
Intergalactic Cowboy
*****
Offline Offline

Posts: 70


« Reply #5 on: June 06, 2007, 09:43:56 PM »

vivalite, your stuff is so cool, thanks for the tip for memory limit.  Hiya
Logged
vivalite
Intergalactic Cowboy
*****
Offline Offline

Posts: 52


« Reply #6 on: June 07, 2007, 01:23:31 AM »

vivalite, your stuff is so cool, thanks for the tip for memory limit.  Hiya

Anytime  Smiling
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: