Hello,

No, these are not the white pills I'm going to ask about ;o). I made one
simple test - 2 virtualservers under Apache and their handlers were:
   1) mod_perl + TT
   2) HTML::Embperl

I used very minimal html 'Hello, world' file for this test - only 85
bytes. Now, if i run apachebench ( ab -t 10 -c 5 http://speed/ )on
mod_perl/TT virtualhost then i get about 10 requests per second, but if
I run bench on Embperl server then i get about 20 request per second.
How come? No DBI, no code, no nothing, but why is Embperl more than 2
times faster? mod_perl/TT handler looks like this:

use strict;
use Template;
use Apache::Constants qw( :common );

sub handler {
   my $r = shift;
   my $troot = $r->dir_config('websrc_root');

   my $template = Template->new({
      OUTPUT => $r,
      EVAL_PERL => 1,
      INCLUDE_PATH => "$troot/src:$troot/lib:$troot/imgs"});

   $r->content_type('text/html');
   $r->send_http_header;

   my $file = 'index.html';
   my $vars = { };

   $template->process($file, $vars, $r) || do {
      $r->log_reason($template->error, $r->filename);
      return SERVER_ERROR;
   };
   return OK;
}
1;

And in httpd.conf it's VirtualHost is like this:

   ServerAlias speed
   PerlSetVar websrc_root /hosts/templates/speed
   DirectoryIndex index.html
 
   <Location />
      SetHandler perl-script
      PerlHandler Inspiral::Speed
   </Location>

Tests were made under same circumstances of course.

Rgds,
Viljo


Reply via email to