You mention that you are having scaling problems, but you don't give us any indication of the numbers. This makes it hard to give suggestions since we have no idea how serious the issue is.

30 seconds to perform a write to a DBM file is insane. How much are you writing? How long is the DBM opened for write access? Are you opening the DBM for write, reading data, performing some calculations and then writing? Do you have more writers than readers? How much data are you talking about? Are the same values consistantly being changed or are changes spread out across your dataset (row level locking won't improve concurency if everyone wants to change the same value).

Unless you are getting really high hit rates, I would guess that you could optimize your code to remove some of these delays that you are observing. I would definately look into MLDBM::Sync if you are not already using it right now. It may allow you to minimize the time needed for your DBM to be open for writing.

In other words, I would look at optimizing your code before looking into delayed writes.

And if all else fails, you could always throw more hardware at your problem...

- Cees


In reply to Re: Caching DBM hash tie by cees
in thread Caching DBM hash tie by Tardis

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.