Re: BenchMarking mod_perl application
by holli (Abbot) on Feb 25, 2005 at 13:04 UTC
|
simply use LWP::Simple and Benchmark:
use strict;
use warnings;
use Benchmark;
use LWP::Simple;
my $t = timeit(1, sub { get "http://www.perlmonks.org"; });
print timestr($t),"\n";
| [reply] [d/l] |
Re: BenchMarking mod_perl application
by CountZero (Bishop) on Feb 25, 2005 at 13:47 UTC
|
Unless you can control the whole of the network the data has to pass through, the results of your benchmarking will be severely conditioned by the status of the network.In my experience such benchmarking is next to useless. What I have done is adding some print statements showing the start-time and end-time of the running of the script and of the start and end-times of the database queries, so you can see where the delay is.
CountZero "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
| [reply] [d/l] |
|
|
| [reply] |
|
|
| [reply] |
Re: BenchMarking mod_perl application
by mpeters (Chaplain) on Feb 25, 2005 at 16:21 UTC
|
Like others have said before me it really depends on what you want to measure. If you have control of the network (meaning you are directly connected to the sever) then holli's advice would probably be the best since it would take into account the server overhead time which should be much better under mod_perl.
If you don't have control over the network, I would say running something like holli's script on the same box would be better than trying it over a messy network. And Javascript would not be able to give you an accurate benchmark of anything other than how long the page takes to render which is not what you are asking (I believe). | [reply] |
Re: BenchMarking mod_perl application
by perrin (Chancellor) on Feb 25, 2005 at 18:07 UTC
|
That difference is too big to be explained by browser rendering. I suspect you are misreading the ab output. How about showing us the command you used to run it and the output? Also, you must know whether the page takes 30 seconds or a fraction of a second. Which is it? | [reply] |
Re: BenchMarking mod_perl application
by hardburn (Abbot) on Feb 25, 2005 at 20:27 UTC
|
Apache goes through several phases to handle a request. After the data is sent to the client, there are some cleanup phases. That could potentially take a while, depending on your configuration.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
| [reply] |
Re: BenchMarking mod_perl application
by RazorbladeBidet (Friar) on Feb 25, 2005 at 13:09 UTC
|
| [reply] |