[CDBI] mysql connections

Rolf Schaufelberger rs at plusw.de
Sun Sep 25 11:14:01 BST 2005


> Hi!
>
> Sorry to bring up this issue again, but I'm not sure what the current state
> 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?
>

If you have one application with ONE connection (= dbuser) there is nothing to 
share. Each apache porcess needs his connection.
You can try to split your application in a frontend and backend server as 
described in the mod_perl tuning guide. A relation of 10 :1 should be 
possible, so the number of db connections will decrease by a factor of ten.
Worked very well for me (yet with a postgres db, but that's not the point). So 
I have 100 frontend servers and 25 backend serves running (I hava a very 
sepcial application where I need some more backend servers).

-- 
Greetings

Rolf Schaufelberger




More information about the ClassDBI mailing list