Server Load
By: Daniel

Monitoring the load on your server is very important and sometimes vital. To do this very quick and easy on your linux server requires 1 line of code to get.

<?php
$load = explode(" ", exec("cat /proc/loadavg"));
echo 'Server Load: '.$load[0].'%&nbsp;&nbsp;'.$load[1].'%&nbsp;&nbsp;'.$load[2].'%';
?>

The above code will output something similar to: Server Load: 0.01% 0.02% 0.00%

**NOTE: Your server must allow you to run the exec() php command. Some hosts disable the execution of this and several other php functions.

4 Votes | Average: 3.75 out of 54 Votes | Average: 3.75 out of 54 Votes | Average: 3.75 out of 54 Votes | Average: 3.75 out of 54 Votes | Average: 3.75 out of 5 (4 votes, average: 3.75 out of 5)
Loading ... Loading ...
del.icio.us:Server Load digg:Server Load spurl:Server Load wists:Server Load simpy:Server Load newsvine:Server Load blinklist:Server Load furl:Server Load reddit:Server Load fark:Server Load blogmarks:Server Load Y!:Server Load smarking:Server Load magnolia:Server Load segnalo:Server Load

One Response to “Server Load”

  1. werutzb Says:

    Hi!

    I want to extend my SQL knowledge.
    I red that many SQL resources and want to
    read more about SQL for my work as mysql database manager.

    What can you recommend?

    Thanks,
    Werutz

Leave a Reply

eXTReMe Tracker
geovisitors