Dear Monks,

I have a caching daemon and several apache mpm_worker processes which connect to a BDB via CHI. These proceses are designed to run for long periods of time without restart as part of a larger web site. After these processes have been running for two weeks or so, I seem to run into this problem when trying to connect to the BDB:
"cannot open Berkeley DB file 'Default.db' in environment '/dev/shm/ca +che/bdb': Lock table is out of available locker entries at '/home/use +r/perl5/lib/perl5/CHI/Driver/BerkeleyDB.pm line 49."
A few Google searches havent really seemed to provide any useful answers or solutions.

The new constructor I'm using for CHI is:
our $chi = CHI->new( driver => 'BerkeleyDB', root_dir => '/dev/shm/cache/bdb', serializer => 'Storable', l1_cache => { driver => 'RawMemory', global => 1, max_size => 2 ** 15, } );
I've also tried the following based on some best guesses how to fix this:
sub _build_chi { my $root_dir = '/dev/shm/cache/bdb'; CHI->new( driver => 'BerkeleyDB', root_dir => $root_dir, serializer => 'Storable', env => BerkeleyDB::Env->new( '-Home' => $root_dir, '-Config' => {}, '-Flags' => DB_CREATE | DB_INIT_CDB | DB_INIT_MPOOL '-LockDetect' => DB_LOCK_OLDEST, ) ); }
But still encounter this issue. I'm guessing this is happening because there are some locks that are being created but not freed up from these long running processes, but I do not know enough about Berekeley DB or the BerkeleyDB Perl extension to know how to solve this. Are there any BDB wizards out there that have encountered this before? Any help is appreciated.

In reply to CHI / BerkeleyDB Locker Entries by mobiusinversion

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.