Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: server load...

  1. #1
    Regular Coder
    Join Date
    May 2004
    Location
    Sydney, Australia
    Posts
    281
    Thanks
    0
    Thanked 0 Times in 0 Posts

    server load...

    how can i display the server load on my webpage so that i have an idea about how intensely my website is used at different times of the day...

  • #2
    Senior Coder
    Join Date
    Apr 2005
    Location
    Colorado, United States
    Posts
    1,208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    $loadavg explode(" "exec("cat /proc/loadavg"));
    echo 
    'Server Load: ' $loadavg[2] . '%'
    "$question = ( to() ) ? be() : ~be();"

  • #3
    Regular Coder
    Join Date
    May 2004
    Location
    Sydney, Australia
    Posts
    281
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i copied your code exactly...but it didn't work...

  • #4
    New Coder
    Join Date
    Aug 2002
    Location
    United Kingdom
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are you sure that the exec() function is enabled on your server? Most have it disabled

  • #5
    Regular Coder
    Join Date
    May 2004
    Location
    Sydney, Australia
    Posts
    281
    Thanks
    0
    Thanked 0 Times in 0 Posts
    is there any test that i can do to find out whether exec() is enabled on the webhost i'm using....i dont have access to the 'php.ini'....

  • #6
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by itsonlybarney
    is there any test that i can do to find out whether exec() is enabled on the webhost i'm using....i dont have access to the 'php.ini'....
    Not sure, but you could always ask them


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •