You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by David Brown <da...@gisajob.com> on 2000/06/07 15:54:48 UTC
PerlRun benefit from shared modules ?
OK, I'm new to all this, and it's by a sheer miracle that I've compiled Perl
5.6, Apache & mod_perl on my BSDI 4.1 box. I may be using completely the
wrong terminology, so please bear with me !
I'm running lots of scripts under Apache::PerlRun, migrating the scripts one
at a time to run in Apache::Registry
My question is: If I add the preload CGI/DBI modules into Apache in my
startup.pl (with use CGI; CGI->compile(':all'); ) will the PerlRun scripts
benefit from that, or is it only Apache::Registry scripts that benefit.
Reason I ask, is that currently all of my scripts under Apache::Registry
have no need for CGI.pm & DBI modules as I've got away with using
Apache::Request to handle requests and they don't access any databases. I
only need CGI / DBI etc. for the PerlRun scripts, and don't want to bloat my
httpd processes with preloading the modules if they're not going be used
for PerlRun scripts.
Does any of that make sense ?
I've also got big problems with memory leaking like a sieve when using
PerlRun.. but I'll pose that one later ! ;-)
BTW: Thanks to all you guys, esp. Doug & Stas for submitting so many
responses in the past that I've been able to search through to get where I
am now !
Re: PerlRun benefit from shared modules ?
Posted by Stas Bekman <sb...@stason.org>.
On Wed, 7 Jun 2000, David Brown wrote:
> Thanks for the response Gunther,
>
> I'll look into running seperate servers.
>
> I'm now preloading CGI & DBI and memory APPEARS to be gobbled a lot slower
> now. Which is nice.
I can see a rain of questions coming :)
David, please read the guide and other docs / mailing list archive before
going any further and asking questions that were answered already. thanks!
> Does DBI automatically pull in DBD, or should I preload Apache:DBD also ?
See my benchmarking post from a few days ago, named "Initializing DBI" --
it's all there. You cannot even ask for numbers because it's there too :)
Have a nice mod_perl learning curve!
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:stas@stason.org http://perl.org http://stason.org/TULARC
http://singlesheaven.com http://perlmonth.com http://sourcegarden.org
Re: PerlRun benefit from shared modules ?
Posted by David Brown <da...@gisajob.com>.
Thanks for the response Gunther,
I'll look into running seperate servers.
I'm now preloading CGI & DBI and memory APPEARS to be gobbled a lot slower
now. Which is nice.
Does DBI automatically pull in DBD, or should I preload Apache:DBD also ?
Re: PerlRun benefit from shared modules ?
Posted by Gunther Birznieks <gu...@extropia.com>.
Yes you get the benefit of shared modules. PerlRun only differs from
registry in the sense that it clears out the namespace of the main script.
As for leaking memory like a sieve? That is not unexpected with PerlRun
scripts because they are typically not coded cleanly. Hell, even our 6 year
old Extropia Perl 4 scripts will run under PerlRun. A surprise. But it
doesn't mean it is efficient.
In fact, I would suggest that you create two backend mod_perl servers, one
for PerlRun and one for your cleaner mod_perl scripts. The PerlRun server
should be set up to destroy itself after much fewer hits... so you could
still get the benefits of the shared module loading because of the
preforked module loading, but the individual apache engines can clean
themselves out sooner.
At 02:54 PM 6/7/00 +0100, David Brown wrote:
>OK, I'm new to all this, and it's by a sheer miracle that I've compiled Perl
>5.6, Apache & mod_perl on my BSDI 4.1 box. I may be using completely the
>wrong terminology, so please bear with me !
>
>I'm running lots of scripts under Apache::PerlRun, migrating the scripts one
>at a time to run in Apache::Registry
>
>My question is: If I add the preload CGI/DBI modules into Apache in my
>startup.pl (with use CGI; CGI->compile(':all'); ) will the PerlRun scripts
>benefit from that, or is it only Apache::Registry scripts that benefit.
>
>Reason I ask, is that currently all of my scripts under Apache::Registry
>have no need for CGI.pm & DBI modules as I've got away with using
>Apache::Request to handle requests and they don't access any databases. I
>only need CGI / DBI etc. for the PerlRun scripts, and don't want to bloat my
>httpd processes with preloading the modules if they're not going be used
>for PerlRun scripts.
>
>Does any of that make sense ?
>
>I've also got big problems with memory leaking like a sieve when using
>PerlRun.. but I'll pose that one later ! ;-)
>
>BTW: Thanks to all you guys, esp. Doug & Stas for submitting so many
>responses in the past that I've been able to search through to get where I
>am now !
>