Some remarks/ideas for the logs:

> Every page is several database accesses

getNodeByID in Everything/NodeBase.pm is using a cache when accessing the DB.

472: sub getNodeById 473: { ... 488: # See if we have this node cached already 489: $cachedNode = $this->{cache}->getCachedNodeById($N); 490: return $cachedNode unless ($selectop eq 'force' or not $cach +edNode);

see also Everything/NodeCache.pm

I suppose the gods have increased the cache-size from the initial 300 in Everything/NodeBase.pm?

095: $db->{cache} = new Everything::NodeCache($this, 300);
Does the caching prioritize based on access count, I have to admit this is not easy to grasp.

> so there is no set of "hot" nodes.

there is no set of hot posts (which are internally nodes) but specific code and html nodes certainly are heavily used internally (AFAICS is 99,9% of the monastery held in DB-nodes)

> and several Perl eval calls

using memoization of in Everything/HTML.pm might help here to avoid unnecessary compilations

968: sub evalCode { 969: my( $code )= shift @_; 970: my( $CURRENTNODE )= shift @_; 971: # Note! @_ is left set to remaining arguments! ... 985: my $str = eval $code; ...

(tho there might be a side effect of pre-compiling into an extra sub layer)

something like (untested)

my $sub = $evalcode_cache{$str} //= eval " sub { $str }"; my $str = $sub->(@_);

html caching

an internal caching of the result of std_node_display into the DB might help too, but here plenty of side parameters need to be taken into consideration.

A caching for Anomonk alone must take into consideration (at least)

A pragmatic solution would be to not list the content of all replies for Anomonk, just the links to the direct replies.

The "print view w/o replies" is already close, but doesn't include links to children replies yet.

compare https://perlmonks.org/?node_id=11164875;displaytype=print

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery


In reply to Re^5: Perlmonks site has become far too slow by LanX
in thread Perlmonks site has become far too slow by stevieb

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.