On Fri, 2004-02-13 at 12:03, Morbus Iff wrote:
> My initial (newb) impression was
> that PerlRun is for quick porting, Registry is more proper.

The main difference is that PerlRun compiles your script every time and
clears out globals in the current namespace every time.

> (my MaxRequestsPerChild
> is set to 30

That's very low.  Why did you do that?  Were you having problems with
higher numbers?

I use Apache::SizeLimit and set MaxRequestsPerChild to 0 (unlimited).

> The scripts, installer.cgi and index.cgi, share nearly the exact
> same code, except for the location of the templates. The location
> of these template files is determined by $0 - if it's installer.cgi,
> we set $var to one directory, if it's index.cgi, we set $var to
> another directory. This $var setting is done in LibDB::Settings,
> which is used by both scripts.

Using a global for that is not such a good idea.  Any value you put in
there will persist between requests.  That is one common source of this
sort of "caching" complaint.  The other is accidentally creating
closures.  Look for situations where you do something like this:

my $foo = 7;

sub bar {
    print $foo;
}

That will cache the value of $foo between requests.

> What I'm seeing, with the same frequency as the above problem,
> is a warning that the object method ->connect can not be found.
> LibDB::DB->new returns a LibDB::DB::MySQL class (which itself
> uses DBI and DBD::mysql). LibDB::DB::MYSQL contains a ->connect
> function, which is a mere wrapper around DBI's. Why it can't be
> found perplexes me: enough reloads later, and database access
> is working just fine. This doesn't sound like caching whatsoever.

Make sure you aren't opening a database connection during server
startup.  Throw in a log statement where you connect to the database and
make sure it doesn't happen before you send in a request.

That's all I have time for now.  Hope that helps a little.

- 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

Reply via email to