Sihal has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks, I would like to bench a script that is called by apache...
I would like in fact to bench the load of the machine completely, not only the script.
So here's my question : what exactly should be measured when benchmarking a script ? what data is the most likely to give a good idea of how it will go in real life ?
Basically the idea is to figure out what king of machine i'll need when working in production with 100,000 users, thanx to a bench done on my server with a more limited number of users... I don't know if i'm clear, feel free to ask question.
  • Comment on how to benchmark a script called by apache

Replies are listed 'Best First'.
Re: how to benchmark a script called by apache
by joe++ (Friar) on Oct 01, 2002 at 13:34 UTC
    Hi,

    I would urgently advise you to stress-test the whole machine before going into production. All environmental factors should be similar to the live situation (esp. network connectivity).

    The next problem is imposing some "real world load", which can be simulated using a couple of desktop PC's.

    I found Microsoft's Webtool excellent for its configurability and real-world experiment design. You must have a couple of Windows PC's though, and have Administrator rights on at least one of them.

    A thorough HOWTO can be found here: Load Testing Web Applications using Microsoft’s Web Application Stress Tool.

    HTH!

    --
    Cheers, Joe

      Groovy thanx, i'll check the URL right away. I was starting to look at modules like Devel::DProf or Benchmark::timer, any opinions on theses ?
      it's kinda difficult to plan such a benchmark. If I happen to find a correct methodology, I'll post it here right away
Re: how to benchmark a script called by apache
by trs80 (Priest) on Oct 01, 2002 at 15:33 UTC
      yup seems quite an interesting tool. so for now i'll be loading my server with WAS, beznch apache with ab, and the perl scripts with Benchmark::Timer ....
        Crashed my production serrver with WAS . :-( but now I know the limit :-)
Re: how to benchmark a script called by apache
by Jaap (Curate) on Oct 01, 2002 at 13:17 UTC
    I would like in fact to bench the load of the machine completely, not only the script.

    This is not the way to go i.m.h.o. If you know the time (in milliseconds) it takes to generate 1 view on your current machine, you can extrapolate that into the cpu power you need to handle a certain amount of views per minute.

    With the code below you can make a timer on each view.

    use Time::HiRes qw(gettimeofday); my ($seconds, $microseconds) = &gettimeofday; print "Seconds: $seconds\nMicroseconds: $microseconds\n"; # do some stuff here ($seconds, $microseconds) = &gettimeofday; print "Seconds: $seconds\nMicroseconds: $microseconds\n";