[rasmus@xxxxxxxxxx: Re: SAPI (Apache 2) question & connection pooling]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Just in case anyone on pgsql-php@xxxxxxxxxxxxxx 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@xxxxxxxxxx> -----

Date: Fri, 1 Feb 2002 09:14:24 -0800 (PST)
From: Rasmus Lerdorf <rasmus@xxxxxxxxxx>
X-X-Sender: rasmus@xxxxxxxxxxxx
To: Frank Joerdens <frank@xxxxxxxxxxx>
cc: php-general@xxxxxxxxxxxxx
Subject: Re: [PHP] SAPI (Apache 2) question & connection pooling
In-Reply-To: <20020201134324.C910@xxxxxxxxxxxxxxxxxxxxxxxx>

> 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 -----


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux