pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Joerdens <frank@joerdens.de>
To: pgsql-php@postgresql.org
Subject: [rasmus@lerdorf.ca: Re: SAPI (Apache 2) question & connection pooling]
Date: Fri, 1 Feb 2002 20:01:11 +0100
Message-ID: <20020201200111.A3958@superfly.archi-me-des.de> (raw)

Just in case anyone on pgsql-php@postgresql.org is not also subscribed
to php-general, here's what Rasmus (just in case anyone doesn't know,
he's The Man as far as strategic PHP issues are concerned, and he also
happened to invent it) says about my questions regarding connection
pooling and persistent connections: 

----- Forwarded message from Rasmus Lerdorf <rasmus@lerdorf.ca> -----

Date: Fri, 1 Feb 2002 09:14:24 -0800 (PST)
From: Rasmus Lerdorf <rasmus@lerdorf.ca>
X-X-Sender: rasmus@christine.ca
To: Frank Joerdens <frank@joerdens.de>
cc: php-general@lists.php.net
Subject: Re: [PHP] SAPI (Apache 2) question & connection pooling
In-Reply-To: <20020201134324.C910@superfly.archi-me-des.de>

> a) if Apache 2 is a single-process server (as opposed to Apache 1.x which
> forks a new process for a new request)

It is a hybrid server which can be anything from one to the other.

> b) if PHP will work, or does work, with Apache 2 in this mode

It works today.

> c) how database connection pooling will work with a single http/php
> multithreaded server process

There is no database pooling.

> d) if maybe integrating php with a servlet engine as described in
>
> http://www.php.net/manual/en/ref.java.php
>
> allows you to use connection pooling via jdbc or something . . . ?

Sure.

> I am asking because connection pooling as it works now with persistent
> connections is pretty awkward, and leads me to look with envy on the
> Aolserver/TCL crowd . . . (I like PHP and see no reason to switch to TCL
> except for the connection pooling issue).

Why do you think you need connection pooling?  Having contention for a
small set of connections is certainly not going to speed anything up.  Is
it because you have license issues and are only allowed a limited number
of concurrent connections?

One easy way to deal with this today is to have a second instance of
Apache set up that has MaxClients set to the max number of database
connections you want.  Then serve up scripts that need to talk to the
database from that server.  A little SquidGuard rule in your
squid reverse-proxy can do this very elegantly.

There are also other options in the works for this problem.  The SRM
project addresses this and when/if Apache2 ever gets stable and people
start using it, I am sure someone will write some pooling code.

-Rasmus

----- End forwarded message -----



Message-ID: <20020201200111.A3958@superfly.archi-me-des.de>
Permalink:  ../20020201200111.A3958@superfly.archi-me-des.de/
Also on:    postgresql.org/message-id/20020201200111.A3958@superfly.archi-me-des.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: frank@joerdens.de
  Subject: Re: [rasmus@lerdorf.ca: Re: SAPI (Apache 2) question & connection pooling]
  In-Reply-To: <20020201200111.A3958@superfly.archi-me-des.de>
  References: <20020201200111.A3958@superfly.archi-me-des.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox