Loking For A Script

Status
Not open for further replies.

netmonster

Active Member
81
2010
0
0
Looking For A Script

Hello,
After Many Faced Problems With My Webhoster About Using Much Server Ressources , My Accout Was Suspended Many Times For That .

That's Why I Am Looking For A Script, A Tool Or ... To Know How Much I Use From Server Ressources .

Is It Possible ?

I Am Waiting For Your Replies !

Thanks In Advance
 
9 comments
Not sure how good you are at php but if you put this into a txt file and rename it as something.php upload it and run it it will tell you what your server load is at as well as your current uptime.
PHP:
<?php
//GET SERVER LOADS
$loadresult = @exec('uptime');
preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$loadresult,$avgs);

//GET SERVER UPTIME
$uptime = explode(' up ', $loadresult);
$uptime = explode(',', $uptime[1]);
$uptime = $uptime[0].', '.$uptime[1];
$data .= "Server Load Averages $avgs[1], $avgs[2], $avgs[3]\n";
$data .= "Server Uptime $uptime";
echo $data;
?>
If your good then you could modify it so say if server load is above x then search is disabled temporally. I used search as an example as it uses a lot of resources.

Another thing you could disable is the amount of people online display in the footer or online over a period of time as it's pretty useless and uses a lot of resources.
 
Well the thing about shared hosting, is that there is no really easy way of telling.
Most host's don't have anywhere you can monitor your own resources (yet... we are working on some :P ).
But if you keep getting suspended, there are only 2 things that could be causing this:
1 - high traffic, shared hosting is not for big sites. It is for tiny sites.
2 - scripts / plugins - chat boxes, latest posts, vbseo, etc can cause higher cpu usage since some are really badly coded. try to find alternatives or disable them for awhile to see if they help.

Worst case scenario, if you can't find out what's causing it. Just move to semi dedicated hosting or a VPS (since you need to most likely).
 
Not sure how good you are at php but if you put this into a txt file and rename it as something.php upload it and run it it will tell you what your server load is at as well as your current uptime.
PHP:
<?php
//GET SERVER LOADS
$loadresult = @exec('uptime');
preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$loadresult,$avgs);

//GET SERVER UPTIME
$uptime = explode(' up ', $loadresult);
$uptime = explode(',', $uptime[1]);
$uptime = $uptime[0].', '.$uptime[1];
$data .= "Server Load Averages $avgs[1], $avgs[2], $avgs[3]\n";
$data .= "Server Uptime $uptime";
echo $data;
?>
If your good then you could modify it so say if server load is above x then search is disabled temporally. I used search as an example as it uses a lot of resources.

Another thing you could disable is the amount of people online display in the footer or online over a period of time as it's pretty useless and uses a lot of resources.

only works if commands are disabled.
and that script is for the whole server not your account.
I think he's on shared hosting.

Nice share though :)
 
Status
Not open for further replies.
Back
Top