PHP script that shows server load

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • damn
    Junior Member
    • Mar 2004
    • 18

    #1

    PHP script that shows server load

    Is there such script? Like on some forums in debug mode. And "how many mysql queries" would be good too
  • Amitabh
    Member
    • Mar 2004
    • 78

    #2
    I think "how many sql queries" will be a simple case of counting the queries in a page. As forthe server load, are you asking about the current server load to be displayed or the processor load that the current page execution took?

    For simple processor load on Linux, you can either use the SNMP method, or there is a system call which displays the current load. I am not getting it right now, will post it when I remember it.

    Comment

    • Amitabh
      Member
      • Mar 2004
      • 78

      #3
      In the meantime, you can take a look at this http://pecl.php.net/package/statgrab

      Comment

      • anguz
        Member
        • Mar 2004
        • 47

        #4
        I think you could use
        PHP Code:
        @shell_exec('uptime'
        That's what I use in a mod I wrote for SMF to disable some actions when the load is above a certain point.

        Comment

        • Frank Hagan
          Senior Member
          • Mar 2004
          • 724

          #5
          Originally posted by Amitabh
          For simple processor load on Linux, you can either use the SNMP method, or there is a system call which displays the current load. I am not getting it right now, will post it when I remember it.
          The "top" command will give you the running processes on the server, and the load each is putting on it.

          Comment

          Working...