Hi Jochen,

>
> to be honest, I don't understand the details of your patch.
> I understand that you fork off some child processes and
> and use connect_cached. But how do the different processes
> interact? How do you guarantee, that the data from one
> client reaches the right server process?
>

There is nothing more to understand, that's all what I do. There is no
interaction between the childs of the server process.

The client connects to one server child, does all it's database i/o and then
disconnects (when it disconnects from the db handle). So all database
interaction from one client occurs with one server child process and there
is no need to exchange data between the childs. Of course, the next time the
same client connects to the server, it normaly doesn't get the same server
child, but this doesn't matter very much. You end up with that every server
childs process has an open connection to the database and if a client comes
to a server process which already has opened the connection to the requested
database, the server childs process doesn't need to connect anymore. It's
similiar as with Apache and using Apache::DBI under mod_perl. By defining
the number of childs you limit the maximum number of database connections
you will open.

I use it in an environment where normaly Apache::DBI keeps my database
connections open, but there some seldom used connections and I don't like to
end up with to many open connections. On the other side I don't like to
connect for every request (because Orcale connects are slow), so
DBI::ProxyServer holds the connection open for me and limits the number of
open connections (and therefore the need for licences and resources).

Is this more clear now?

Gerald

P.S. Of course it would be much better to do the same with threads, but from
what I know so far not all DBD drivers are thread safe and it would me
require to install a second threaded Perl.

Does anybody know which DBD drivers are thread safe, not by simply
serializing all calls via a mutex, but in a way that let them allow multiple
requests at the same time within different threads, but in the same process?



-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     [EMAIL PROTECTED]         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to