Interesting. Why did you have to install PgBouncer? Can't Postgres
handle remote connections from your web server?
I don't use Postgres, but reading the description of PgBouncer I can
see some things you'd want to consider.
First, Apache::DBI prevents you from making persistent connections
before the parent process forks. If you don't use it, you should
check your code to make sure that it closes any handles it opens
during server startup.
Second, there's the issue of what happens when your code throws an
exception. Apache::DBI will issue a rollback on any active handles
that aren't in autocommit mode after each request. If you don't use
it, I'd suggest adding your own cleanup handler to do a rollback.
Finally, there's the issue of performance. It's not clear whether DBI
connects faster when using PgBouncer. You should probably benchmark
that yourself. You may still get a significant speed boost from
caching the connections (with Apache::DBI) on the client side.
On Tue, Apr 22, 2014 at 10:02 AM, jbiskofski wrote:
I just want to confirm something with all you smart folks.
I recently separated my web servers from my database servers, before I was
using Apache::DBI to maintain persistent connections between Apache and
Postgres. With this new setup I had to install PgBouncer. Can I now safely
remove Apache::DBI from my application and use regular DBI ??