Poor performance is due the keys not being sorted. One million partially sorted keys on my 500MHz P4 takes 2 minutes. For random keys I only get one tenth the keys stored in that same time or 100k keys in 2 minutes 18. Extrapolating with my numbers it would take a minimum of 6 hours to store 17 million unsorted keys on my system; that's ignoring that larger BTrees take longer to access. Since most of the time is taken up sorting the keys I don't see where changes in parameters will have much effect. This is the price we pay for being able to do random access recall.

The best you could do is buy a faster processor. Nevertheless, things to try are: Verify that your page size is equal to your disk page size. Set your cache size as high as possible within limits of performance for the rest of the system. Are there other users on your system? If no turn of transactions. Are you running out of memory? Look at the output from top.


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}

In reply to Re: Questions about BerkeleyDB by starbolin
in thread Questions about BerkeleyDB by lihao

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.