Dan Horne wrote:
Optimising db connections: cutting down the number of DB connections per
request.
Paul, does your application need more than one connection per request? You
may be connecting to more than one database, schema or user, but if not,
then maybe you don't need so many connections. CGI::Application::Plugin::DBH
may help
Sorry... too true! I am using cgiapp::Plugin::DBH already.
maybe I should have said "DB queries per request". In other words,
making sure that you aren't requesting 8 different pieces of information
from the same table in 3 separate queries during a request.
On this topic, it just occurred to me that I am not sure how the DBH
plugin works. I assume that it opens up 1 connection and does all the
requests through that connection. It only opens the connection if
required too. If so, that's fine by me!
The question stands though - is there a way to "cache" the query
information for all users? Example: the app can be called from 3
different domains, and using the domain information, load 3 different
sets of information and store them for every request (changes every 15
minutes). Does anything do this? It's built in to some application
servers (like ColdFusion - which has lots of faults, but does cache data
in memory for all users very well).
:)
Paul