Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hey folks,

I am speccing out a change to E2, but wanted to run it past some perl-heads so I figured I'd toss it out here for a few ideas. I'm looking for a way to buy myself some more database cycles with which to expand, and doing some nodecache analysis, I think that we can tailor both of our sites by changing the way that the nodecache works to perform delta-encoded update checking, rather than performing an albeit cheap but uberfrequent query on the database

First, we'd create a table, say called delta_nodeversion. This would look like a HEAP table with timestamp,node_id as a key. Everytime we call Everything::NodeCache::incrementGlobalVersion and the type exists in a pre-defined perma-cache list, we would drop the node_id into delta_nodeversion.

Next, every time the page is run (inside of resetCache), it will check the delta_nodeversion for any changes since its last check time it has run. If it has found them, it will immediately go and tombstone those queue items, and let the page run normally. The Everything::NodeCache::isSameVersion then returns 1 for anything in the permanent queue map. When there's nothing in the queue, a big update day would only harm performance a bit, or one could restart your webheads in a controlled fashion and trim the queue afterwards if you were worried about it.

For performance, one might prune the table for entries older than a day, since it's unlikely that all of the apache threads have not all run once in a day.

htmlcodes,htmlpages,superdocs,maintenances,settings,containers,nodetypes,themes and themesettings might all be good candidates for this type of treatment, depending on how much load you want to push from your database onto your memory stack. The basis of this performance increase is based on the theory that it is cheaper to check one table that you can keep small, with a slightly more expensive query, than to check another table 15 times per page.

I'd welcome the feedback on it, thanks


In reply to Delta-encoded permanent items in the nodecache by JayBonci

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (7)
    As of 2018-01-18 12:37 GMT
    Find Nodes?
      Voting Booth?
      How did you see in the new year?

      Results (211 votes). Check out past polls.