<div dir="ltr"><div class="gmail_default" style="font-family:'arial narrow',sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 3, 2016 at 2:32 PM, Michael Ulitskiy <span dir="ltr"><<a href="mailto:mulitskiy@acedsl.com" target="_blank">mulitskiy@acedsl.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><u></u>
<div style="font-family:'Sans Serif';font-size:11pt;font-weight:400;font-style:normal">
<p style="margin:0px;text-indent:0px">George,</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">That's really a great news. I guess I should look at pjsip again then.</p>
<p style="margin:0px;text-indent:0px">Just one question though. I tried to google "full_backend_cache" option, but all I was able to find</p>
<p style="margin:0px;text-indent:0px">is commit message in asterisk-commits list and that message isn't very informative.</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">Can you please explain how it's supposed to be used and what it suppose to do?</p>
<p style="margin:0px;text-indent:0px">If there's any documentation that explains it, please point me there.</p>
<p style="margin:0px;text-indent:0px">Thanks a lot,</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">Michael</p><div><div class="h5">
<p style="margin:0px;text-indent:0px"> </p></div></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-family:'arial narrow',sans-serif">​It's on my list to update the Wiki.</div><div class="gmail_default" style="font-family:'arial narrow',sans-serif"><br></div><div class="gmail_default" style="font-family:'arial narrow',sans-serif">Here's a sorcery.conf example for endpoints...</div><div class="gmail_default" style="font-family:'arial narrow',sans-serif"><br></div><div class="gmail_default" style=""><div class="gmail_default" style=""><font face="arial narrow, sans-serif">endpoint/cache=memory_cache,object_lifetime_stale=3600,object_lifetime_maximum=28800,expire_on_reload=yes,full_backend_cache=yes</font></div><div class="gmail_default" style=""><font face="arial narrow, sans-serif">endpoint=realtime,ps_contacts</font></div><div class="gmail_default" style=""><font face="arial narrow, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="arial narrow, sans-serif">In the normal cache scenario, only direct lookups by id are cached.  With full_backend_cache, all lookups are cached including those that do a 'get all' like the retrieve all to find qualifyable contacts.</font></div><div class="gmail_default" style=""><br></div></div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="font-family:'Sans Serif';font-size:11pt;font-weight:400;font-style:normal"><div><div class="h5">
<p style="margin:0px;text-indent:0px">On Wednesday, March 02, 2016 05:08:51 PM George Joseph wrote:</p>
<p style="margin:0px;text-indent:0px">> On Wed, Mar 2, 2016 at 12:51 PM, Michael Ulitskiy <<a href="mailto:mulitskiy@acedsl.com" target="_blank">mulitskiy@acedsl.com</a>></p>
<p style="margin:0px;text-indent:0px">> wrote:</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> > Hello,</p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> > Since you started to look at it again, let me repeat myself.</p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> > The problem is described in detail here:</p>
<p style="margin:0px;text-indent:0px">> > <a href="http://lists.digium.com/pipermail/asterisk-dev/2015-October/075128.html" target="_blank">http://lists.digium.com/pipermail/asterisk-dev/2015-October/075128.html</a></p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> > It has to do with the fact that at initial load pjsip realtime issues</p>
<p style="margin:0px;text-indent:0px">> > separate db query for each endpoint/aor/etc in the system.</p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> > In my case of ~10K endpoints it took asterisk ~1.5minutes to load.</p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> > Further in that discussion I suggested that having the following API call</p>
<p style="margin:0px;text-indent:0px">> > to populate sorcery cache would go a long way to</p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> > reducing the scale of this problem:</p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> > ast_sorcery_retrieve_by_fields(sip_sorcery,</p>
<p style="margin:0px;text-indent:0px">> > "endpoint",AST_RETRIEVE_FLAG_MULTIPLE | AST_RETRIEVE_FLAG_ALL, NULL);</p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> > I haven't looked at pjsip since the time of that discussion as that's</p>
<p style="margin:0px;text-indent:0px">> > clearly a show-stopper for me, but I doubt anything changed.</p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> > Also I haven't received any feedback if that suggestion is viable, so I'd</p>
<p style="margin:0px;text-indent:0px">> > love to hear your (and/or other developers) opinion on it.</p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> > Any other idea on how to deal with it is more than welcome as well.</p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> ​So part of this I just fixed in review 2312.  The cache is now populated</p>
<p style="margin:0px;text-indent:0px">> at startup.  Together with full_backend_cache there should be *some*</p>
<p style="margin:0px;text-indent:0px">> relief.</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> One of the base issues however is that we can't use the power of SQL to</p>
<p style="margin:0px;text-indent:0px">> narrow down the result set before shipping them all back to Asterisk</p>
<p style="margin:0px;text-indent:0px">> because not all the backends support SQL.  If they did, we could, for</p>
<p style="margin:0px;text-indent:0px">> instance, 'select * from ps_endpoints a, ps_aors b where <a href="http://a.id" target="_blank">a.id</a> = <a href="http://b.id" target="_blank">b.id</a> and</p>
<p style="margin:0px;text-indent:0px">> b.qualify_frequency > 0' (well almost) to get only the endpoints that need</p>
<p style="margin:0px;text-indent:0px">> to be scheduled.  Or 'select * from ps_endpoints where id in</p>
<p style="margin:0px;text-indent:0px">> ('user','user@domain')'.  We just can't do that right now.</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> All is not lost however.  We've been noodling with some ideas on how to</p>
<p style="margin:0px;text-indent:0px">> make this work more efficiently but it's not something that's going to</p>
<p style="margin:0px;text-indent:0px">> happen this week, :)</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> > Thanks,</p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> > Michael</p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> ></p>
<p style="margin:0px;text-indent:0px">> ></p></div></div></div><br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></blockquote></div><br></div></div>