You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Tom Williams <to...@comcast.net> on 2004/05/18 04:34:49 UTC
Help needed with mod_perl-1.99_13 and loading some AWStats modules
Hi! I'm trying to get some help in figuring out why I'm having problems
with some AWStats perl modules in my Apache 2.0.48 (worker
MPM)/mod_perl-1.99_13/Perl 5.8.2 (multi-threaded) on Redhat 9 Linux
environment.
Here is a link to the AWStats weblog analyzer:
http://awstats.sourceforge.net/
Basically, AWStats uses Perl modules that get loaded at runtime to
handle some functions, like displaying icons for identified browsers or
flag icons of identified countries, etc. Intermittently, these modules
behave incorrectly and the expected icons don't appear. I've contacted
the AWStats author (the main developer at least) about this and he's
thinking it's an issue with mod_perl. I don't know if he's right but
I'm coming here to see if this is the case or not. :)
Here are his comments:
" If sometimes flags are here, problem is in loading the domains.pm
(making country array not loaded correctly) file.
Because yo use mod_perl and i known this module has a very special way
to load pm files and to initialize perl variables (variables are kept in
memory between sessions and not reloaded at each load of awstats page),
i think problem comes from mod_perl.
The DomainsHashIDLib array seems to be not always loaded by mod_perl but
i don't know how to solve this."
Here is a link to the thread in question:
http://sourceforge.net/forum/message.php?msg_id=2571309
So, how can I determine what the cause of this intermittent behavior
is? Could it be a problem with the main AWStats Perl script itself or
somehing local to the Perl modules themselves? I have no idea where to
begin tracking this down so ANY help would be greatly appreciated.
Thanks....
Peace.....
Tom
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Help needed with mod_perl-1.99_13 and loading some AWStats modules
Posted by Tom Williams <to...@comcast.net>.
Perrin Harkins wrote:
>On Tue, 2004-05-18 at 10:41, Tom Williams wrote:
>
>
>>Thanks for the info. I'm responding off the list since my mod_perl
>>questions have basically been answered.
>>
>>
>
>You really should keep these questions on the list. Others on there are
>much more knowledgeable than I am about threads.
>
>
>
>>So, based on your distinction above for each multi-threaded child
>>process that is running that process will have 25 Perl interpreters, one
>>per thread in each process? Or does each multi-threaded process get a
>>Perl interpreter that is shared among the threads in each process?
>>
>>
>
>There is one interpreter per thread. You can actually set that so that
>there are fewer interpreters than threads, but that just means that if a
>request comes in that needs mod_perl for processing and all interpreters
>are busy, it will wait for one. This is all explained in the mod_perl 2
>docs.
>
>- Perrin
>
>
>
Thanks for all the info! :)
Peace...
Tom
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Help needed with mod_perl-1.99_13 and loading some AWStats modules
Posted by Perrin Harkins <pe...@elem.com>.
Tom Williams wrote:
> I do notice that from time to time the multi-threaded child
> processes will die off and new ones spawn and I understand this is
> normal for the Apache 2.0 work MPM. So, each time a child process
> terminates the Perl interpreter for that process goes with it and the
> new child gets a new interpreter, correct?
Well, with the worker MPM it's threads, not processes, but essesntially
the same otherwise.
Also, I should have mentioned that under mp2 the module is called
ModPerl::PerlRun, not Apache::PerlRun.
- Perrin
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Help needed with mod_perl-1.99_13 and loading some AWStats modules
Posted by Tom Williams <to...@comcast.net>.
Perrin Harkins wrote:
> Tom Williams wrote:
>
>> " If sometimes flags are here, problem is in loading the domains.pm
>> (making country array not loaded correctly) file.
>> Because yo use mod_perl and i known this module has a very special
>> way to load pm files and to initialize perl variables (variables are
>> kept in memory between sessions and not reloaded at each load of
>> awstats page), i think problem comes from mod_perl.
>> The DomainsHashIDLib array seems to be not always loaded by mod_perl
>> but i don't know how to solve this."
>
>
> Actually, mod_perl is not doing anything special here. Perl normally
> keeps things in memory after you've compiled them, for as long as the
> interpreter is alive. You don't typically see the consequences of
> this because with a CGI script the perl interpreter exits right away,
> taking everything it had in memory with it.
Cool! I do notice that from time to time the multi-threaded child
processes will die off and new ones spawn and I understand this is
normal for the Apache 2.0 work MPM. So, each time a child process
terminates the Perl interpreter for that process goes with it and the
new child gets a new interpreter, correct?
> The problem with domains.pm is that it doesn't follow the rules for
> Perl5 modules: it has no package declaration. This causes you to hit
> the problem documented here:
> http://perl.apache.org/docs/1.0/guide/porting.html#Name_collisions_with_Modules_and_libs
>
Ok, I'll look into this.
> You may be able to make it work by running it under Apache::PerlRun,
> which is slower, but tries harder to support legacy code with
> namespace problems.
Great! Thanks!
Peace...
Tom
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Help needed with mod_perl-1.99_13 and loading some AWStats modules
Posted by Perrin Harkins <pe...@elem.com>.
Tom Williams wrote:
> " If sometimes flags are here, problem is in loading the domains.pm
> (making country array not loaded correctly) file.
> Because yo use mod_perl and i known this module has a very special way
> to load pm files and to initialize perl variables (variables are kept in
> memory between sessions and not reloaded at each load of awstats page),
> i think problem comes from mod_perl.
> The DomainsHashIDLib array seems to be not always loaded by mod_perl but
> i don't know how to solve this."
Actually, mod_perl is not doing anything special here. Perl normally
keeps things in memory after you've compiled them, for as long as the
interpreter is alive. You don't typically see the consequences of this
because with a CGI script the perl interpreter exits right away, taking
everything it had in memory with it.
The problem with domains.pm is that it doesn't follow the rules for
Perl5 modules: it has no package declaration. This causes you to hit
the problem documented here:
http://perl.apache.org/docs/1.0/guide/porting.html#Name_collisions_with_Modules_and_libs
You may be able to make it work by running it under Apache::PerlRun,
which is slower, but tries harder to support legacy code with namespace
problems.
- Perrin
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html