At 01:07 -0800 1/18/04, Stas Bekman wrote:
Elizabeth Mattijsen wrote:
>Coming back to the original issue. Is it really so bad to load everything "automatically" if >you're using a prefork MPM?
You can if you want to. That's definitely won't be the default. Don't forget that mp2 is much more than mp1. And people may want to use just one of its modules (e.g. a filter) w/o using modperl itself. Would you want to have 40+ modules preloaded for you when you need only 2?

Well, yes. But that is tuning. If you want people to easily migrate, I think making it the default would be best from a user friendliness point of view. Maybe add a warning to the error log if you're doing it the lazy way.


*** Note: currently all xxxx modules have been loaded. This may not be the most efficient
*** way of using Apache 2. Please check xxxx for more tuning information.


Ideally, have a message added to the error log at shutdown time with a list of modules that
were actually used during the run,


*** According to usage statistics, you should change the following lines in your config:
aaaa
bbbb
ccccc


although I wonder how one would do that.

Just brainstorming here: maybe the default should be to load just package specific AUTOLOAD subs for each package, whose only function would be to set a flag that the package was being used and then load the real package?

Something like (more or less pseudo code here)

startup:

foreach (qw(Foo Bar)) {  # all of the appropriate Apache modules
    my $package = "Apache::$_";
    *{$package.'::AUTOLOAD'} = sub {
         if ($INC{$package}) {
# real error, sub not found after package loaded
         } else {
             (my $filename = $package) =~ s#::#/#s;
             require "$filename.pm";
             goto &${$package.'::AUTOLOAD'};
         }
    }
}


shutdown:


my @module;
foreach (qw(Foo Bar)) {
    my $package = "Apache::$_";
    push @module,$INC{$package};
}
if (@module) {
    warn "*** According to....\n";
    warn "   $_\n" foreach @module;
}


> It will all get shared, won't it?
You know how well perl gets its sharing working. Even though most of this code is C, it manipulates perl vars internally so a lot of it won't survive sharing.

True.



Or is the problem that you don't know which MPM you're using when the first PerlRequire is being handled?
No, whe should know which mpm is used once mp is loaded and before any of its modules are loaded (well we need to load Apache::MPM for that purpose if we want to know that in perl)

Good. So that shouldn't be the problem then...



Liz


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to