Re: Re: [NOVICE] Re: re : PHP and persistent connections

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: ron(at)Opus1(dot)COM
Cc: Alain Toussaint <nailed(at)videotron(dot)ca>, PostgreSQL Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [NOVICE] Re: re : PHP and persistent connections
Date: 2000-11-27 15:18:48
Message-ID: 3.0.1.32.20001127071848.01b23440@mail.pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-novice

At 12:38 AM 11/27/00 -0700, Ron Chmara wrote:
>Don Baccus wrote:
>> At 12:07 AM 11/26/00 -0500, Alain Toussaint wrote:
>> >how about having a middle man between apache (or aolserver or any other
>> >clients...) and PosgreSQL ??
>> >that middleman could be configured to have 16 persistant connections,every
>> >clients would deal with the middleman instead of going direct to the
>> >database,this would be an advantage where multiple PostgreSQL server are
>> >used...
>> Well, this is sort of what AOLserver does for you without any need for
>> middlemen.
>
>What if you have a server farm of 8 AOL servers, and 12 perl clients, and
>3 MS Access connections, leaving things open? Is AOLserver parsing the
>Perl DBD/DBI, connects, too? So you're using AOLserver as (cough) a
>middleman? <g>

Well, no - we'd use the built-in Tcl, Python or nsjava (still in infancy)
modules which interface natively to AOLserver's built-in database API.

You don't NEED the various connection implementations buried in various
languages because they're provided directly in the server. That's the
point. That's the main reason people use it.

If you're going to run CGI/Perl scripts using its database connectivity
stuff, don't use AOLserver. They'll run since AOLserver supports CGI,
but they'll run no better than under Apache and probably worse, since
no one doing serious AOLserver work uses CGI and therefore the code which
implements it has languished - there's no motivation to improve something
that no one uses.

If you're willing to use a language module which exposes the AOLserver
API to your application, then AOLserver's a great choice.

>> Again, reading stuff like this makes me think "ugh!"
>> This stuff is really pretty easy, it's amazing to me that the Apache/db
>> world talks about such kludges when they're clearly not necessary.
>
>How does AOL server time out access clients, ODBC connections, Perl
>clients? I thought it was mainly web-server stuff.

Well, for starters one normally wouldn't use ODBC since AOLserver
includes drivers for PostgreSQL, Oracle and Sybase. There's one for
Solid, too, but no one seems to use Solid since they raised their
prices drastically a couple of years ago (if you're going to spend
lots of money on a database, Oracle and Sybase are more than willing
to help you). Nor does nsjava use JDBC, it encapsulates the AOLserver
API into a database API class(es?).

AOLserver manages the database pools in about the same way it manages
threads, i.e. if a thread can't get the handles it needs (usually only
one, sometimes two, more than that usually indicates poorly written
code) it blocks until another thread releases a handle. When a thread
ends (returns a page) any allocated handles are released. Transactions
that haven't been properly committed are rolled back as well (lesser of
two evils - the event's logged since it indicates a bug).

For each pool you provide the name of the driver (which of course serves
to select which RDMBS that pool will use - you can use as many different
RDBMSs as you have, and have drivers for), a datasource, the maximum
number of connections to open for that pool, minimum and maximum lifetimes
for connections, etc.

- Don Baccus, Portland OR <dhogaza(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Guus Kerpel 2000-11-27 15:47:06 Size of my data base?
Previous Message Marko Kreen 2000-11-27 13:21:17 Re: Re: [GENERAL] Warning: Don't delete those /tmp/.PGSQL.* files

Browse pgsql-novice by date

  From Date Subject
Next Message Ross J. Reedstrom 2000-11-27 16:46:08 Re: Re: [NOVICE] Re: re : PHP and persistent connections
Previous Message Ron Chmara 2000-11-27 07:56:03 Re: Re: [NOVICE] Re: re : PHP and persistent connections