forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: andy_cul on July 07, 2005, 12:50:59 am

Title: Server Load Status
Post by: andy_cul on July 07, 2005, 12:50:59 am
Hi its me again  ;D

Would like to request this mod which displays the status of the server's load. Thanks
Title: Re: Server Load Status
Post by: kegobeer on July 07, 2005, 03:24:24 am
Why?  What would be the benefit of such an addition?  How does this relate to Coppermine?
Title: Re: Server Load Status
Post by: OmegaGOD on July 07, 2005, 03:58:06 am
I'm not sure if this is really a feature that would be benificial to most users. This is more of a server script and not coppermine related.  It sounds like you want custom options for your specific implementation of CPG. If this is something that you would really like on your site, I would recommend putting a request in our Freelancers / Paid Help board. Maybe someone there would be willing to code it for you for a couple of bucks.

Freelancers / Paid Help Board -> http://forum.coppermine-gallery.net/index.php?board=30.0

--OmegaGOD
Title: Re: Server Load Status
Post by: Joachim Müller on July 07, 2005, 10:02:56 am
how's coppermine to "know" your server load? How should a php script find out? Of course, you could store two temporary time stamps: one, when the script starts executing and one when it ends. By comparing those two time stamps, you could get an idea how fast the page was built and as a result get an idea on the server load, but it'd be only a rough estimate. Imo it'd be better to use dedicated monitoring tools to find out about server performance.
Title: Re: Server Load Status
Post by: Nibbler on July 07, 2005, 08:38:23 pm
You can just read the values from /proc/loadavg if you're on a *nix server, it's not particularly difficult. Makes sense to get to know the load pattern of your server and avoid using batch add when server load is high. I may code it as a mod at some point.
Title: Re: Server Load Status
Post by: andy_cul on July 08, 2005, 06:18:01 pm
thanks for the help guys  :D
Title: Re: Server Load Status
Post by: Stramm on July 15, 2005, 09:17:39 pm
it's pretty easy for nix.... just some preg_match on uptime... that's it

Code: [Select]
<?php
preg_match
("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",@exec('uptime'),$load);
echo 
$load[1].", ".$load[2].", ".$load[3]."";
?>

Windows as far as I know doesn't save load averages
Title: Re: Server Load Status
Post by: OmegaGOD on July 15, 2005, 10:10:16 pm
I am marking this thread as invalid as it is not a valid feature request for CPG. This is more of a server feature request.

@Stramm, Thanks for contributing that sniplet of code.