Re: [ILUG] Re: unison

From: Fergal Daly (fergal at domain esatclear.ie)
Date: Fri 11 Feb 2000 - 23:48:05 GMT


At 22:00 11/02/00 +0000, Niall wrote:
>On Fri, 11 Feb 2000, John McCormac wrote:
>
>> fewer open database connections to achieve the results. (There is a very
>> good explanation of this in Philip Greenspun's article on
>> Oracle/AOLserver on the Linuxworld site or in his Database Backed
>> Websites book at http://photo.net/wtr/ ) The number of connections open
>> to the database would be the critical aspect of such a design and
>> AOLserver wins on this.
>
>Read the book again John - the important aspect here, and the one which
>philg harps on about is NOT the number of connections open but the fact
>that in the AOLserver there is a pool of open connections, and when a TCL
>procedure requires a database connection, it just asks for one from the
>pool, thus saving the overhead of opening a new connection and closing it
>again for a simple query. I imagine that a little imagination could
>provide such a solution with Apache and modperl - in fact with modperl
>you'd need to mind you back to make sure that this didn't happen
>inadvertently :-) However, it is of course integrated into AOLserver and
>thoroughly tested. But you do have to program in TCL rather than Perl :-(

It's a fairly standard trick in mod_perl too I think. Just make sure each
forked server opens a db connection first thing. Then every cgi call uses
that connection. Have a look at the ApacheDBI module for a standard way to
do it,

http://www.perl.com/CPAN-local/modules/by-module/Apache/ApacheDBI-0.87.tar.gz

Fergal



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:05:24 GMT