Re: [CDBI] Re: Class::DBI and mod_perl

"Aaron Trevena" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
On 21/11/06, Edward J. Sabol <sabol-2oVx0MVsMgiP/[email protected]> wrote:
> The main problem you *might* encounter with mod_perl and CDBI, which is not
> addressed by the wiki, is CDBI's "Live Objects" cache. You have to be very
> careful with your scoping if you want to use that cache. If not or you
> experience problems, it's easily deactivated. But it is good discipline for
> reducing memory leaks, I think.

I didn't think the live objects cache was that much of a problem, but
disabled it anyway (mostly because the application runs on multiple
nodes and so needs to ensure it has a fresh copy from the db)

The biggest memory use I found was the query/handle caching done in
Ima::DBI, so pass 0 as your third argument to set_sql to avoid it.
I've never found this to be a problem in a mod_perl environment - I
needed to stop it happening in my scheduler which needs to run for
months or years, in a normal mod_perl 1.x environment you probably
won't notice.

With no live object cache and no statement caching I found my
scheduler was able to run for weeks at a time with no increase of
memory usage.

Cheers,

A.


-- 
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Hosting
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.