Have you looked at "Perl Cookbook"? It has nice discussion on prefork
server.

you can customize it according to your requirement.
e.g.
You can control exactly how many DB connection you want(background processes
which keep persistance connection to database). You can move this to another
server if you want or use as Unix Domain (as it's very fast compare to
TCP/IP socket).

Niraj

-----Original Message-----
From: Leslie Mikesell [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 29, 1999 11:00 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: pool of DB connections ?


According to Oleg Bartunov:

> I'm using mod_perl, DBI, ApacheDBI and was quite happy
> with persistent connections httpd<->postgres until I used
> just one database. Currently I have 20 apache servers which
> handle 20 connections to database. If I want to work with
> another database I have to create another 20 connections
> with DB. Postgres is not multithreading
> DB, so I will have 40 postgres backends. This is too much.
> Any experience ?

Try the common trick of using a lightweight non-mod_perl apache
as a front end, proxying the program requests to a mod_perl
backend on another port.  If your programs live under directory
boundaries you can use ProxyPass directives. If they don't you
can use RewriteRules with the [p] flag to selectively proxy
(or [L] to not proxy).  This will probably allow you to cut
the mod_perl httpd's at least in half.  If you still have a
problem you could run two back end httpds on different ports
with the front end proxying the requests that need each database
to separate backends.  Or you can throw hardware at the problem
and move the database to a separate machine with enough memory
to handle the connections.

  Les Mikesell
   [EMAIL PROTECTED]

Reply via email to