On Mon, 14 Nov 2005 10:46:56 +1100
"Brett Randall" <[EMAIL PROTECTED]> wrote:
> Does anyone else have any ideas as to how I can utilise persistent
> database connections to a MySQL server via DBI, in order to speed up
> web queries, but without the 20 or so connections per virtual server
> that sit there waiting for something to happen? Should I be doing this
> differently?
Unfortunately Apache::DBI is doing exactly what you've told it to
do. You may be able to avoid this issue if you change how your
application works, but that really depends on what it is doing
and how.
Here are some ideas that might help:
1) Ensure that your StartServers and Min/MaxSpareServers are
setup so that there are just enough processes hanging around
to handle your load, but no more. The idea being the less
Apache children around the less database connections you are
using.
2) Stop using connect_on_init(). While this will slightly slow
down the first query per Apache child, it won't take up
database connections until the child actually needs to do
something.
3) Try things without Apache::DBI. In some situations Apache::DBI
and persistant connections are crucial, but I have found with
several apps in the past that it made little to no difference
in the end user experience. It is at least worth a try to see
if the performance change is something you can live with.
Hope this helps!
---------------------------------
Frank Wiles <[EMAIL PROTECTED]>
http://www.wiles.org
---------------------------------