[rasmus@lerdorf.ca: Re: SAPI (Apache 2) question & connection pooling]

Поиск
Список
Период
Сортировка
От Frank Joerdens
Тема [rasmus@lerdorf.ca: Re: SAPI (Apache 2) question & connection pooling]
Дата
Msg-id 20020201200111.A3958@superfly.archi-me-des.de
обсуждение исходный текст
Список pgsql-php
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 -----

В списке pgsql-php по дате отправления:

Предыдущее
От: Frank Joerdens
Дата:
Сообщение: DBBalancer (was: apache-php-postgresql connection question)
Следующее
От: Frank Joerdens
Дата:
Сообщение: Re: SAPI (Apache 2) question & connection pooling