What does everyone use to benchmark their php/mysql scripts.. I'm not talking about just execution times, I'm talking about simulating heavy load on those particular scripts while monitoring the servers resources. Or maybe there is something that can perhaps tell me how much memory/cpu a script will take up. The only tool i've seen so far is ab, I haven't tried it yet because i'm going to have to make a linux box to try it out.

After reading this good, but dated article on php and server resources, I would like to start writing code thats not only fast but efficient. http://phplens.com/lens/php-book/optimizing-debugging-php.php

    Have you though of trying a simple counter such as this?

    
    function getmicrotime()
    {
      list($usec, $sec) = explode(" ",microtime());
       return ((float)$usec + (float)$sec);
    }
    
    $time = getmicrotime();
    
    /*
    * benchmark code here
    */
    
    echo "<p>Time elapsed: ",getmicrotime() - $time, " seconds";
    
    

    Alternativly you can visit this webpage: PHP Optimizing

    Hopy you figure it out 🙂 - Rob

    Edit: Oops, didn't know you already had that link posted -- But its still a great reference 🙂

      Write a Reply...