Re: Runtime Database connections- one more time

[prev] [thread] [next] [Date index for 2005/01/24]

From: Perrin Harkins
Subject: Re: Runtime Database connections- one more time
Date: 01:36 on 24 Jan 2005
Bo Strinnholm wrote:

> I have been using Class::DBI for some time now and it has been kind of 
> disturbing not to get a real foundation for how to treat the case when I 
> need to use separate databases for my clients though they are using the 
> same application.

You can try Class::DBI::Factory, or else use the approach you have here.

> Is this the optimal way?

Looks okay, but db_Main() gets called very frequently, i.e. multiple 
times per request.  You might want to cache the database handle in 
pnotes() after you fetch it, and grab it form there for the remainder of 
the request.

> Many clients = many sleeping database processes?

That will mostly go away if you use a front-end proxy server.  Also, you 
could see how much of a hit you take from disabling persistent 
connections.  It's not that much slower with MySQL.

- Perrin

Runtime Database connections- one more time
Daniel Collis Puro 17:27 on 23 Jan 2005

Re: Runtime Database connections- one more time
Perrin Harkins 18:48 on 23 Jan 2005

Re: Runtime Database connections- one more time
Bo Strinnholm 23:25 on 23 Jan 2005

Re: Runtime Database connections- one more time
Perrin Harkins 01:36 on 24 Jan 2005

Generated at 16:37 on 28 Jul 2005 by mariachi v0.52