<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Abdul,<br>
      <br>
      OK, but what is the blacklist related operation you do in startup
      route ?? As far as I know, the blacklist module is not doing any
      kind of caching, so any check you do against the blacklists will
      translate into a DB query, right ?<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>
OpenSIPS Bootcamp 2018
  <a class="moz-txt-link-freetext" href="http://opensips.org/training/OpenSIPS_Bootcamp_2018/">http://opensips.org/training/OpenSIPS_Bootcamp_2018/</a>
</pre>
    <div class="moz-cite-prefix">On 10/01/2018 06:58 PM, Abdul Basit
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAGQG5Mb_A5X2_8YAv7LS7-HFQWhu601ps22M=r5WsyA5sWSB_w@mail.gmail.com">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">Yes. That's right.</div>
              <div dir="ltr">The code I am using is as below. <span style="background-color:rgb(254,254,238);color:rgb(102,102,102);font-family:"Lucida Console","Andale Mono","Courier New",Courier;font-size:11.7072px;white-space:pre">globalblacklist</span> table
                has complete number as <span style="background-color:rgb(254,254,238);color:rgb(102,102,102);font-family:"Lucida Console","Andale Mono","Courier New",Courier;font-size:11.7072px;white-space:pre">prefix</span><span style="background-color:rgb(254,254,238);color:rgb(102,102,102);font-family:"Lucida Console","Andale Mono","Courier New",Courier;font-size:11.7072px;white-space:pre"> </span>with
                and <span style="background-color:rgb(245,245,245);color:rgb(102,102,102);font-family:"Lucida Console","Andale Mono","Courier New",Courier;font-size:11.7072px;white-space:pre">whitelist</span> status. 
                 </div>
              <div dir="ltr">
                <div>
                  <div><br>
                  </div>
                  <div>
                    <div>
                      <div class="hljs bash"
style="display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248);font-family:monospace">
                        <div>route {</div>
                        <div><span style="white-space:pre">       </span>.....</div>
                        <div><span style="white-space:pre">       </span><span
                            class="hljs-keyword"
                            style="font-weight:bold">if</span> (
                          !check_blacklist(<span class="hljs-string"
                            style="color:rgb(136,0,0)">"globalblacklist"</span>)
                          ) {</div>
                        <div><span style="white-space:pre">               </span>xlog(<span
                            class="hljs-string"
                            style="color:rgb(136,0,0)">"L_NOTICE"</span>,<span
                            class="hljs-string"
                            style="color:rgb(136,0,0)">"[<span
                              class="hljs-variable"
                              style="color:rgb(188,96,96)">$fU</span>/<span
                              class="hljs-variable"
                              style="color:rgb(188,96,96)">$tU</span>/<span
                              class="hljs-variable"
                              style="color:rgb(188,96,96)">$ci</span>] [<span
                              class="hljs-variable"
                              style="color:rgb(188,96,96)">$rm</span>]
                            Destination [<span class="hljs-variable"
                              style="color:rgb(188,96,96)">$rU</span>]
                            is not Allowed. Dropping call.\n"</span>);</div>
                        <div><span style="white-space:pre">               </span>sl_send_reply(<span
                            class="hljs-string"
                            style="color:rgb(136,0,0)">"403"</span>, <span
                            class="hljs-string"
                            style="color:rgb(136,0,0)">"Forbidden"</span>);</div>
                        <div><span style="white-space:pre">               </span><span
                            class="hljs-built_in"
                            style="color:rgb(57,115,0)">exit</span>;</div>
                        <div><span style="white-space:pre">       </span>}</div>
                        <div><span style="white-space:pre">       </span><span
                            class="hljs-keyword"
                            style="font-weight:bold">else</span> {</div>
                        <div><span style="white-space:pre">               </span>xlog(<span
                            class="hljs-string"
                            style="color:rgb(136,0,0)">"L_INFO"</span>,
                          <span class="hljs-string"
                            style="color:rgb(136,0,0)">"[<span
                              class="hljs-variable"
                              style="color:rgb(188,96,96)">$fU</span>/<span
                              class="hljs-variable"
                              style="color:rgb(188,96,96)">$tU</span>/<span
                              class="hljs-variable"
                              style="color:rgb(188,96,96)">$ci</span>] [<span
                              class="hljs-variable"
                              style="color:rgb(188,96,96)">$rm</span>]
                            INBOUND CALL for [<span
                              class="hljs-variable"
                              style="color:rgb(188,96,96)">$ru</span>]"</span>);</div>
                        <div><span style="white-space:pre">               </span>route(10);</div>
                        <div><span style="white-space:pre">               </span><span
                            class="hljs-built_in"
                            style="color:rgb(57,115,0)">exit</span>;</div>
                        <div><span style="white-space:pre">       </span>}</div>
                        <div><span style="white-space:pre">       </span>.....</div>
                        <div>}</div>
                      </div>
                    </div>
                    <br>
                  </div>
                  <div><br clear="all">
                    <div>
                      <div dir="ltr" class="gmail_signature">
                        <div><font size="2"><span
                              style="font-family:verdana,sans-serif"><span
                                style="color:rgb(39,78,19)">--<br>
                                regards,</span></span></font></div>
                        <font size="2"><span
                            style="font-family:verdana,sans-serif"><span
                              style="color:rgb(39,78,19)"><br>
                              abdul basit</span></span></font></div>
                    </div>
                    <br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Mon, 1 Oct 2018 at 19:07, Bogdan-Andrei Iancu
          <<a href="mailto:bogdan@opensips.org"
            moz-do-not-send="true">bogdan@opensips.org</a>> wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor="#FFFFFF" text="#000000"> <tt>Hi Abdul,<br>
              <br>
              IF I understand correctly, you use startup route to load
              (from DB?) some blacklists into localcache ?<br>
              <br>
              Regards,<br>
            </tt>
            <pre class="m_2718947286626188160moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="m_2718947286626188160moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank" moz-do-not-send="true">http://www.opensips-solutions.com</a>
OpenSIPS Bootcamp 2018
  <a class="m_2718947286626188160moz-txt-link-freetext" href="http://opensips.org/training/OpenSIPS_Bootcamp_2018/" target="_blank" moz-do-not-send="true">http://opensips.org/training/OpenSIPS_Bootcamp_2018/</a>
</pre>
            <div class="m_2718947286626188160moz-cite-prefix">On
              09/28/2018 04:10 AM, Abdul Basit wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <div>Hi team,</div>
                <div><br>
                </div>
                <div>I have a opensips 2.4 deployed having 4 children
                  and with mysql configured for loading user blacklist
                  to opensips local cache on opensips startup.<br>
                </div>
                <div>Opensips work fine on filtering the call based on
                  user blacklist records loaded into local cache. </div>
                <div><br>
                </div>
                <div>While blacklist was growing upto 1.3m records,
                  opensips startup was taking ~60 sec on VM of 16GB RAM
                  and 6 CPU.<br>
                </div>
                <div>I increased shared memory to <b>6144</b> and
                  package memory to <b>256.</b><br>
                </div>
                <div>Filter works fine here yet. Call load is not that
                  much only blacklist entries are growing.</div>
                <div><br>
                </div>
                <div>But now blacklist has grown to very huge number, up
                  to 10m records in mysql. Opensips is not starting
                  successfully and service startup requests timeout
                  after huge CPU spikes while trying to populate local
                  cache from mysql. <br>
                </div>
                <div>I increased shared memory to <b>12288</b> and
                  package memory to <b>1024</b> but no success yet.</div>
                <div><br>
                </div>
                <div>I indexed mysql blacklist table but no luck.</div>
                <div><br>
                </div>
                <div>Please advise what settings I should add to
                  opensips for successful startup. </div>
                <div><br>
                </div>
                <div>
                  <div dir="ltr"
                    class="m_2718947286626188160gmail_signature"
                    data-smartmail="gmail_signature">
                    <div><font size="2"><span
                          style="font-family:verdana,sans-serif"><span
                            style="color:rgb(39,78,19)">--<br>
                            regards,</span></span></font></div>
                    <font size="2"><span
                        style="font-family:verdana,sans-serif"><span
                          style="color:rgb(39,78,19)"><br>
                          abdul basit</span></span></font></div>
                </div>
              </div>
              <br>
              <fieldset
                class="m_2718947286626188160mimeAttachmentHeader"></fieldset>
              <br>
              <pre>_______________________________________________
Users mailing list
<a class="m_2718947286626188160moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="m_2718947286626188160moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
            </blockquote>
            <br>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>