icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » All Things Techy » Site Maintenance » [Self-serve] Server Load Button

Site Maintenance Program updates, securing your website, creating backups.

Reply
 
LinkBack Thread Tools Search this Thread
Old February 1st, 2007, 10:18 PM   #19 (permalink)
DemonicAngel
Super #1
 
twirp's Avatar
 
Joined in Aug 2004
Lives in Wherever The World Takes Me
Hosted on Pass76
1,847 posts
Gave thanks: 28
Thanked 35 times
Twirpin it up
Added a bit of a twist?
__________________
You wear Vans so high school kids will think that you can skate. He wears Vans because he can skate. TwiRp wears Vans because they were on sale. Pass76 wants Vans.
twirp is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
These users thank twirp for this great post!
Edwin (February 3rd, 2007), Kayla (February 1st, 2007)
Old February 1st, 2007, 10:30 PM   #20 (permalink)
Marketing Maven
Surpass Staff
 
Kayla's Avatar
 
Joined in May 2003
Lives in Orlando
24,749 posts
Gave thanks: 946
Thanked 806 times
Twirp, we need instructions for that ASAP!
__________________
Follow Surpass on Twitter and Facebook
Check out the Surpass Blog



Kayla is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 1st, 2007, 10:41 PM   #21 (permalink)
DemonicAngel
Super #1
 
twirp's Avatar
 
Joined in Aug 2004
Lives in Wherever The World Takes Me
Hosted on Pass76
1,847 posts
Gave thanks: 28
Thanked 35 times
Quote:
Originally Posted by Kayla View Post
Twirp, we need instructions for that ASAP!
This is what I did...:
PHP Code:
<?php
/* name:        severload.php
   Author:      Jesse Chilcott
   Description: This script creates a horizontal meter that shows the server load
   Useage:      link to the script as if it is an image
*/

/* get server load */
        
if (file_exists("/proc/stat") == true)
        {
            
//$fp = @fopen("/proc/loadavg", "r");
            //if (empty($fp) == false)
            //{
            
if($lost_averages = @file_get_contents("/proc/stat")){
                
//$load_averages = @fread($fp, 64);
                
$load_averages = @file_get_contents('/proc/loadavg');
                
$loadavg explode(" "$load_averages);
                
//fclose($fp);
                
$loadav $loadavg[0];  // we don't want to many digits or it will overlap the meter
                
$data explode(" "$lost_averages);
                
$user $data[2];
                
$nice $data[3];
                
$system $data[4];
                
$idle $data[5];
                
$total $user $nice $system $idle;
                
                
$meterwidth = (1-((($idle  100.0)/$total) / 100.0)) * 205;
                
$percent round((1-((($idle  100.0)/$total) / 100.0)) * 1000) / 10;
            }
            else
            {
                
$loadav   "error";
            }
        }
        else
        {
            
$loadav   "error";
        }


header("Content-type: image/png");

/* get and set more image and font details */
$im imagecreatefrompng("dn_angel_468x60.png");

$width imagesx($im);
$height imagesy($im);

$xLoc 250;
$yLoc 30;

$green imagecreatefrompng("green_bar.png");
$red imagecreatefrompng("red_bar.png");
$white imagecolorallocate($im,255,255,255);


/* do meter bar */
if ($loadav != "error") {
    
imagecopyresized($im,$green,$xLoc,$yLoc,0,0,205,15,10,10);
    
imagecopyresized($im,$red,$xLoc,$yLoc,0,0,$meterwidth,15,10,10);
    
$loadav round($loadav 10) / 10;
    
//imagefilledrectangle ( $im, 48 ,4, 48 + $meterwidth, $height-6, $metercolor );
    //imagerectangle ( $im, 48,4, 76, $height-6, $bordercolor2 );
}
imagestring($im,3,$xLoc,$yLoc'Load: '.$loadav.', CPU Useage: '.$percent.'%',$white);
/* output gif image to browser */
imagepng($im);
imagedestroy($im);

//echo "\n".$loadav.":".$meterwidth;
?>
It probably increases the load more than need be... (if it is, I'll change it)

The images were:
http://statimg.lost-whisper.info/dn_angel_468x60.png
http://statimg.lost-whisper.info/red_bar.png
http://statimg.lost-whisper.info/green_bar.png
__________________
You wear Vans so high school kids will think that you can skate. He wears Vans because he can skate. TwiRp wears Vans because they were on sale. Pass76 wants Vans.
twirp is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
These users thank twirp for this great post!
Bigjohn (February 2nd, 2007), Edwin (February 3rd, 2007), mgk (April 7th, 2007)
Old February 2nd, 2007, 9:29 AM   #22 (permalink)
Surpass Fan
On a golden path...
 
Joined in Mar 2006
Hosted on SH100
458 posts
Gave thanks: 75
Thanked 17 times
Nope. Not working for me either. I don't see any image in my sig.
__________________
SH100 , SH131 & SH124
Sentinel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 2nd, 2007, 9:35 AM   #23 (permalink)
Marketing Maven
Surpass Staff
 
Kayla's Avatar
 
Joined in May 2003
Lives in Orlando
24,749 posts
Gave thanks: 946
Thanked 806 times
I do now!
__________________
Follow Surpass on Twitter and Facebook
Check out the Surpass Blog



Kayla is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 2nd, 2007, 10:15 AM   #24 (permalink)
Registered User
Fresh Surpasser
 
Joined in Jun 2006
21 posts
Gave thanks: 1
Thanked 0 times
Quote:
Originally Posted by Kayla View Post
Martina,

I looked at SH100 and noticed that one of the sites in your sig is one of the top sites on the server, it's pretty popular! You may want to consider a VPS very soon... the site in question is drinking a lot of SH100's juice.
Oh dear....
it is just an actor's fansite and a board, no more...I did not even add a downloads section yet as many other fansites have.
A VPS is over my student's money, even with what I get through the google ads -
I'd have to move away to another host.

Can I contact you personally to find a solution before it is too late?
__________________
love, Martina.

Sites at surpass: http://inspirationally.org and http://johnny-depp.org

SH 100
server
Martina is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 2nd, 2007, 1:51 PM   #25 (permalink)
Registered User
Excelling Contributor
 
Joined in Feb 2005
544 posts
Gave thanks: 88
Thanked 24 times
Neat! Tks for posting the script, Kayla. It works on my webstatus page as well.
__________________
Patty

Pass 57 | Dime999 | SH 110
Patty is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 2nd, 2007, 2:45 PM   #26 (permalink)
Surpass Fan
On a golden path...
 
Joined in Mar 2006
Hosted on SH100
458 posts
Gave thanks: 75
Thanked 17 times
Of course now that I can see my server load it begs the question ... what is a normal server load
__________________
SH100 , SH131 & SH124
Sentinel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 2nd, 2007, 10:07 PM   #27 (permalink)
Marketing Maven
Surpass Staff
 
Kayla's Avatar
 
Joined in May 2003
Lives in Orlando
24,749 posts
Gave thanks: 946
Thanked 806 times
Quote:
Originally Posted by Bigjohn View Post
On a XEON processor, loads over 5-6 are bad. On a dual core Opteron thing still work up to 7-8 range.

Of course, it's best for your loads to be around 1 or lower.
__________________
Follow Surpass on Twitter and Facebook
Check out the Surpass Blog



Kayla is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On