G'day Kbeen,

Everyone has given good advice above me, but I thought I'd add my personal experience as well. I've also worked on projects where speed was critical, and for the most speed-critical parts we used custom persistant caches to keep things speedy.

The implementation of such a cache is fairly straightforward, pretty much a hash with a daemon running around it. During quiet moments the cache is cleaned with old nodes removed and/or flushed to disk/database. Connection is usually via a unix domain socket.

If you have your front-end scripts populating the cache on misses, then you can have a very simple and very fast single-threaded cache. It can be used with any of the other strategies (databases, disk files, DBM files, etc) mentioned above. It can pre-populate itself with information if desired.

I'd suggest you think twice before having your cache make HTTP connections to the remote server. While this seems very elegant from a design standpoint (ask cache, get back answer, don't care about hit or miss), it means you run the risk of your cache being blocked on HTTP, or seriously increasing the complexity of the code. A misbehaving cache can kill your overall performance when everything depends upon it.

Hope that your project gets well and that your customers are blinded by its speed. ;)

Cheers,
Paul


In reply to Re: I need speed... by pjf
in thread I need speed... by kbeen

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.