ApacheBench'ing PHP page

Discussion in 'Site & Server Administration' started by Lucky Bastard, Mar 30, 2005.

  1. #1
    I'm trying to test the performance of a fairly large PHP (not earth shattering) script using ApacheBench (which I just discovered by accident today in google. :cool:).

    However I am getting results that confuse me. An extract when benchmarking 30 request, concurrency 1:
    Complete requests : 30
    Failed requests : 29 (connect:0, Length:29, Exceptions:0)

    Failed requests? WHAT THE? :) The site is up and working.

    Can anyone give me a helping hand and explain this? Can't find anything in google.


    THANKS!
     
    Lucky Bastard, Mar 30, 2005 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    What's the URL to it? I was looking for something to benchmark PHP, but never found anything (didn't look *too* hard of course). heh
     
    digitalpoint, Mar 30, 2005 IP
  3. hulkster

    hulkster Peon

    Messages:
    1,705
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ApacheBench is part of standard apache distribution - see APACHE-INSTALL-DIR/bin/ab

    This is a nice quick-n-dirty way to benchmark stuff to see if changes helped - was real helpful when I was fiddling with mod_perl.

    No ideas on the "Failed Requests" - sorry.
     
    hulkster, Mar 30, 2005 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    I know... I figured it out after I posted it. :)
     
    digitalpoint, Mar 30, 2005 IP
  5. mushroom

    mushroom Peon

    Messages:
    369
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I start my pages (for testing) with
    $t1=microtime(); $t4=date('U');
    PHP:
    and end them with
    $t2=microtime(); $t5=date('U'); $t6=$t5-$t4; $t3=$t2-$t1; $t7=$t6+$t3;
    echo "<br><strong>This HTML Page was Dynamically Generated and written Specifically for You.
    &nbsp; This page took &nbsp; $t7 &nbsp;seconds to write.</strong>\n";
    PHP:
     
    mushroom, Mar 30, 2005 IP