Forum Moderators: coopster

Message Too Old, No Replies

What is this script telling me please

         

Champak

11:17 pm on Apr 19, 2007 (gmt 0)

10+ Year Member



I came across this script that is suppose to tell me about my server load, but I don't understand what it is telling me besides when the numbers are high and when they are low

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

Why are there three numbers instead of just one? Why are they all different? What do all three mean?

Thanks

borntobeweb

12:45 am on Apr 20, 2007 (gmt 0)

10+ Year Member



Those three numbers are from the Unix uptime command and tell you the load average during the last 1, 5, and 15 minutes. Load average is the average number of processes running or in queue during that period, so on a single-processor server, a load average of 1 means the cpu is 100% busy, on a 4-processor server the cpu is 100% busy at 4. A high number means your processes are being slowed down by lack of cpu resources. You can search these forums or google for "load average" to get more info. Hope this helps.