<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Bill,<br>
<br>
That is interesting. I can put in my two cents to say: we do not use
a database scenario other than the primary/secondary replication
scenario. Where primary is a single machine and receives updates.
The secondary is configured in read-only streaming replication. All
of the bricks are configured to talk to primary IP/hostname. It
would seem that this patch could bring about a speedup for us with
no downside, unless I'm mistaken.<br>
<pre class="moz-signature" cols="72">-Blake-
Conducting Magic
Will consume any data format
MOBIUS
</pre>
<div class="moz-cite-prefix">On 3/20/2023 3:07 PM, Bill Erickson via
Evergreen-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAEjrdbr2PZukud4p_B=QdtEiOqmySvDBuSEvKe9kyK9JRUq7tQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr"><font face="monospace">Hi All,</font>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">I was recently reviewing some
activity logs and found these top 5 API calls (with counts)
for last Thursday:</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace"> 46398 <a
href="http://open-ils.pcrud.retrieve.au"
moz-do-not-send="true">open-ils.pcrud.retrieve.au</a><br>
41363 open-ils.actor.get_barcodes<br>
33044 open-ils.pcrud.transaction.begin<br>
32591 open-ils.pcrud.transaction.rollback<br>
30549 open-ils.pcrud.search.atc<br>
</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">Way down the list I have:</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace"> 452
open-ils.pcrud.transaction.commit<br>
</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">If I take out the ~450 begin/commit
pairs, which perform real work, I'm left with ~65k begin +
rollback API calls. That's roughly 1 of every 10 API calls
that hit our system.</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">Not only are there a lot of them,
each results in a begin or rollback call in the database.
The calls are fast and generally harmless on a per-call
basis, but they do make it to the database every time, so
they're not exactly trivial/superficial.</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">The begin/rollback pairs are the
result of using "authoritative" data retrieval -- calls that
start a database transaction so the caller can be sure any
data retrieved comes from the primary database. This is
useful when a) data must be up to date to avoid
confusion/oddness in the UI and b) the Evergreen system is
running one or more pooled database replicas that handle
live read queries -- live replicas can occasionally lag
behind with replication and return very slightly older data
than the primary database.</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">For sites like KCLS, where all live
queries go to one primary database, these API calls serve no
purpose. (We have replicas, but they are not part of an
active load-balanced pool. They are used instead for
reporting, bulk data collection, debugging, and of course
backups).</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">Since these begin + rollback pairs
(and ".authoritative" APIs) serve no purpose in our
environment, I was considering creating a local patch to
disable them. However, before I start patching locally, </font><span
style="font-family:monospace">I'm curious if there is a
broader desire for deprecating authoritative APIs? I
suspect they can be turned into NO-OP's with 2 or 3
well-placed lines of code.</span></div>
<div><span style="font-family:monospace"><br>
</span></div>
<div><span style="font-family:monospace">Do many/any of you use
live, read-only pooled database replicas?</span></div>
<div><span style="font-family:monospace"><br>
</span></div>
<div><span style="font-family:monospace">I'd love to hear your
thoughts/concerns/etc.</span></div>
<div><span style="font-family:monospace"><br>
</span></div>
<div><span style="font-family:monospace">Thanks,</span></div>
<div><span style="font-family:monospace"><br>
</span></div>
<div><span style="font-family:monospace">-b</span></div>
<div><br>
</div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace"><br>
</font></div>
<div><span style="font-family:monospace"><br>
</span></div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Evergreen-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Evergreen-dev@list.evergreen-ils.org">Evergreen-dev@list.evergreen-ils.org</a>
<a class="moz-txt-link-freetext" href="http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-dev">http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>