[Templates] Re: sharing memory under mod_perl

Brad Bowman template@bowman.bs
09 Oct 2003 10:06:30 +1000


darren chamberlain wrote:
> * Brad Bowman <template at bowman.bs> [2003-10-07 08:24]:
> 
>>The mod_perl guide has advice for loading CGI & DBI at
>>apache startup time to improve memory sharing.
> 
> Since version 2.55 (last November), Template.pm will preload all the
TT2
> modules if it detects $ENV{MOD_PERL}.  This means that a simple
>   PerlModule Template

I was considering the compiled sub form of documents, 
not the TT2 modules.  (I didn't make that clear)

If the code for my index, header, etc could be loaded, compiled and
potentially shared, that might be a great memory saving.
I am after the TT2 equivalent of preloading Apache::Registry scripts:

  # in apache_start.pl
  Apache::RegistryLoader->new->handler("/perl/test.pl",
                    "/home/httpd/perl/test.pl");

Since TT2 already caches the compiled form, I suspect it would be easy
to preload the cache at apache start time.  
Does anyone already do this?
   
Brad
  
PS. We converted from HTML::Template to TT2 sometime ago and didn't
get anywhere near the memory sharing we had.  Just recently I
thought that multiple copies of tt2 document/subs might be the
culprit.  Just speculating...

-- 
  One should not open his mouth wide or yawn in front of another. Do
  this behind you fan or sleeve. 
                              -- Hagakure http://bowman.bs/hagakure/