|
Joined: Jan 2003
Posts: 263
Member
|
Member
Joined: Jan 2003
Posts: 263 |
For my forums I've set the online time to 10 minutes. I think that by decreasing the online time, you have a much better overview of who is "REALLY" online at that moment. This can also be usefull when you want to get in contact with someone who is online at that moment. Or is there a good reason for setting this to 90 minutes ? 
|
|
|
|
Joined: Aug 2000
Posts: 3,590
Moderator
|
Moderator
Joined: Aug 2000
Posts: 3,590 |
the lower the number, the higher the server load
|
|
|
|
Joined: Feb 2002
Posts: 1,759
Addict
|
Addict
Joined: Feb 2002
Posts: 1,759 |
server load is the biggest reason. When you have larger sites with sometimes 100+ online at a time, and you have all of those people refreshing the who's online box with every page they load, it can really slow things down 
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
I like to pop in and see who's been here - and I can't check in every 10 minutes. 
|
|
|
|
Joined: Feb 2002
Posts: 1,759
Addict
|
Addict
Joined: Feb 2002
Posts: 1,759 |
josh is a stalker 
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
[] Jeremy said:server load is the biggest reason. When you have larger sites with sometimes 100+ online at a time, and you have all of those people refreshing the who's online box with every page they load, it can really slow things down  [/] really? intresting, my site has quite a few people online most of the time, (70+ on my 15min window) so if I up this to say 30 mins, it'll reduce my load? Will try this out! Are there any figures of how increasing the time affects load?
|
|
|
|
Joined: Aug 2004
Posts: 173
Member
|
Member
Joined: Aug 2004
Posts: 173 |
[]monkeyra said: Will try this out! Are there any figures of how increasing the time affects load? [/]
Monk, I noticed you have changed the refresh time, did it make much difference?
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
havent checked my server load yet. must get around to it....
|
|
|
|
Joined: Sep 2003
Posts: 803
Coder
|
Coder
Joined: Sep 2003
Posts: 803 |
 load this script into a file named "serverload.php" and upload it to yor server then call it up in the browser. It will tell you. <?php<br /><br /> $loadavg_array = explode(" ", exec("cat /proc/loadavg"));<br /> $loadavg = $loadavg_array[2];<br /> print("Server load: " . $loadavg . "%");<br />?> This little code will tell you how long the server has been up since last reboot.. we can call this one server-uptime.php <p><font color="#999999"> <br /><?<br />function linuxUptime() {<br /> $ut = strtok( exec( "cat /proc/uptime" ), "." );<br /> $days = sprintf( "%2d", ($ut/(3600*24)) );<br /> $hours = sprintf( "%2d", ( ($ut % (3600*24)) / 3600) );<br /> $min = sprintf( "%2d", ($ut % (3600*24) % 3600)/60 );<br /> $sec = sprintf( "%2d", ($ut % (3600*24) % 3600)%60 );<br /> return array( $days, $hours, $min, $sec );<br />}<br />$ut = linuxUptime();<br />// If you would like to show the seconds as well just add [ , $ut[3] seconds ] after minutes.<br /><br />echo "Time since last reboot: $ut[0] days, $ut[1] hours, $ut[2] minutes, $ut[3] seconds"<br />?><br /></font></p> 
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
ahhh, cool little script! thanks!
|
|
|
|
Joined: Sep 2003
Posts: 803
Coder
|
Coder
Joined: Sep 2003
Posts: 803 |
Ya, Both of thoose should be added to that "Stats Page" we talked about on the other thread. You could see the server oad and uptime with all the stats from the forum.
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
dang, thats a good idea 
|
|
|
|
Joined: Feb 2002
Posts: 2,286
Veteran
|
Veteran
Joined: Feb 2002
Posts: 2,286 |
Monkeyra,
Not sure about a 'stats page' but if you want to include this on your control panel index page....
In templates/default/admin/login.tmpl
### ###find ###
$pa_link $db_link $modq_link
### ###Change to ###
$pa_link $db_link $modq_link
<br /> <br />
UBBTPRINT;
$loadavg_array = explode(" ", exec("cat /proc/loadavg")); $loadavg = $loadavg_array[2]; print("Server load: " . $loadavg . "%");
echo <<<UBBTPRINT
<br /> <br />
UBBTPRINT;
function linuxUptime() { $ut = strtok( exec( "cat /proc/uptime" ), "." ); $days = sprintf( "%2d", ($ut/(3600*24)) ); $hours = sprintf( "%2d", ( ($ut % (3600*24)) / 3600) ); $min = sprintf( "%2d", ($ut % (3600*24) % 3600)/60 ); $sec = sprintf( "%2d", ($ut % (3600*24) % 3600)%60 ); return array( $days, $hours, $min, $sec ); }$ut = linuxUptime(); print ("Time since last reboot: $ut[0] days, $ut[1] hours, $ut[2] minutes, $ut[3] seconds"); echo <<<UBBTPRINT
<br /> <br />
------------------
This is very similar to Dr. C's code except I am using the print command rather than the .echo
Fans Focus - Focusing on Fans of Sport (Okay - mainly football (the British variety at the moment - but expanding all the time....)
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
Thanks guys. this is such a handy little tool!
|
|
|
|
Joined: Jan 2003
Posts: 263
Member
|
Member
Joined: Jan 2003
Posts: 263 |
Thanks Ian_W!
Now what is a "healthy" server load ?
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
This is something i've been researching. AFAIK (and it's only from what i've read) it's a bit of a subjective measure, factors such as server specs can mean what might be considered a high load on a lesser machine, it's acceptable on a higher-spec machine. What i'd like to know though, is what is it a measure of? Is it measured from 0-100%? or 0-10? whats the parameters?
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
|
|
Forums63
Topics37,575
Posts293,931
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|