Re: [CDBI] mysql connections

[prev] [thread] [next] [Date index for 2005/09/22]

From: David Baird
Subject: Re: [CDBI] mysql connections
Date: 11:45 on 22 Sep 2005
On 9/22/05, Thomas Klausner <domm@xxx.xx> wrote:
> Hi!
>
> Sorry to bring up this issue again, but I'm not sure what the current sta=
te
> of affairs is regarding this issue:
>
> I have a rather big CDBI based application runnning on a server I have
> nearly no access rights to. The sysadmins complain that the app is using =
to
> much connections to the MySQL DB.
>
> It's a fairly standard CDBI setup running with mod_perl and Apache::DBI.
>
> Do I need to add a custom db_Main method as described here
>   http://wiki.class-dbi.com/index.cgi?UsingWithModPerl
> to get the mysql connection numbers down?
>
> Or are there any other ways to properly share one connection to mysql in =
all
> Apache children?
>
> Is it in fact advisable to share one connection?
>
> Thanks!

You're not sharing one connection among children. You're ensuring that
each child maintains its own permanent connection.

If you're running multiple vhosts, which are running different
applications, you're getting a separate connection, per
vhost/application, per child. Mounts up fast.

If only some of the Apache children are servicing requests to your app
(others to other vhosts, or idle), you've got lots of unused
connections hanging around.

Since it's MySQL, try running without Apache::DBI. The connections are
built and disposed of very quickly, you might not notice any
difference, but your sysadmins probably will.

d.

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] mysql connections
Thomas Klausner 11:40 on 22 Sep 2005

Re: [CDBI] mysql connections
David Baird 11:45 on 22 Sep 2005

Re: [CDBI] mysql connections
Rolf Schaufelberger 10:14 on 25 Sep 2005

Generated at 17:55 on 28 Sep 2005 by mariachi v0.52