perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan <a...@ufies.org>
Subject Re: virtualhost based variables
Date Wed, 02 Oct 2002 23:52:12 GMT
On Wed, Oct 02, 2002 at 06:04:03PM -0500, James G Smith wrote:
> Alan <alan@ufies.org> wrote:
> >Greetings again.
> >
> >I'm trying to figure out the best/fastest/most elegant way of setting
> >virtualhost based variables.  Basically I have three sites, and the only
> >difference between them is the DocumentRoot ($htdocroot) and the database
> >their data is being accessed from ($dbh).
> 
> Document root should be accessable from $r.
> 
> I would use Apache::DBI for persistent connections.  Then connect at
> the beginning of the request with the DBI connection parameters
> coming from $r->dir_config.

Yup, and this is exactly how I have it working right now.  Each module
starts by re-instantiating $dbh and $htdocroot via dir_config and a
function that uses dir_config to find the database it's supposed to grab
stuff from.

The problem is that it seems like I've incurred a pretty high speed
penalty, and my requests/sec have dropped from about 165 to 83 :(  I'm
still pushing enough data to saturate a T1, so at the end it's not 
going to be a noticable difference.  I wanted to know if there was a
better/faster way to do this though, without having to call $r->dir_config
and $r->document_root for /every/ request.

Alan

-- 
Alan "Arcterex" <alan@ufies.org>   -=][=-   http://arcterex.net
"I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I
think I preferred the cows. They were better conversation, easier to milk, and
if they annoyed me enough, I could shoot them and eat them." -Rodger Donaldson

Mime
View raw message