Hi everyone,

I've introduced a Cache::BerkeleyDB based caching mechanism into a web application I'm working on, and it seems to work fine at first, but breaks down when I give it a bit more data.

I have an expensive computation that pre-loads the cache with about 20,000 values. Running it reproduceably wedges the bdb database:

Can't create BerkeleyDB::Env (home=/data/webdata/cache): DB_RUNRECOVERY: Fatal error, run database recovery at /apps/perl-5.8.6/lib/site_perl/5.8.6/Cache/BerkeleyDB_Backend.pm line 29, <DATA> line 225.

Running the exact same query with a smaller input works fine. This is under mod_perl, but I have been testing it with a single httpd process, so I don't think it's a concurrency issue.

Any idea where I should look to solve this?

In the meantime I've been using Cache::File instead, but both the performance and space-efficiency are unacceptable (I think it would be ok on something like reiserfs, but I'm stuck on ext3). Because of the size of the data memory based caches won't work for me, so BDB was really the all-around best solution; if I can't get this working I'll have to go to a relational database, and I'd rather avoid the hassle.

Thanks in advance.


In reply to Cache::BerkeleyDB Problems by glwtta

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.