<div dir="ltr">Yes. I understand and I check that point specifically. <br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div>Thank you for your quick solution.</div><div><br></div><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><br><div class="gmail_quote"><div dir="ltr">On Wed, 3 Oct 2018 at 00:37, Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org">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>
      Thanks for the feedback. I just want to be sure you understand
      that the change I did does not speed up the loading process, but
      it simply decouples the startup sequence from the data loading
      process. Shortly OpenSIPS does not have to wait for the DB data to
      be loaded in order to start up.<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="m_8230626994823735588moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="m_8230626994823735588moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a>
OpenSIPS Bootcamp 2018
  <a class="m_8230626994823735588moz-txt-link-freetext" href="http://opensips.org/training/OpenSIPS_Bootcamp_2018/" target="_blank">http://opensips.org/training/OpenSIPS_Bootcamp_2018/</a>
</pre>
    <div class="m_8230626994823735588moz-cite-prefix">On 10/02/2018 07:22 PM, Abdul Basit
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div dir="ltr">Thanks a lot. 
                            <div>Earlier status</div>
                            <div>
                              <div>Opensips service was started in <b>(<font color="#ff0000">real 1m6.474s</font>)</b></div>
                              <div><br>
                              </div>
                              <div>
                                <div class="m_8230626994823735588gmail-hljs m_8230626994823735588gmail-apache" style="display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248);font-family:monospace">
                                  <div>
                                    <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">#
                                        time opensipsctl fifo
                                        reload_blacklist</span></div>
                                    <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">WARNING:
                                        database engine not found -
                                        tried 'MYSQL'</span></div>
                                    <div><br>
                                    </div>
                                    <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">real 
                                          0m3.948s</span></div>
                                    <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">user 
                                          0m0.039s</span></div>
                                    <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">sys 
                                           0m0.013s</span></div>
                                  </div>
                                </div>
                              </div>
                              <br>
                              <div>
                                <div class="m_8230626994823735588gmail-hljs m_8230626994823735588gmail-css" style="display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248);font-family:monospace">
                                  <div><span class="m_8230626994823735588gmail-hljs-selector-tag">time</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">systemctl</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">stop</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">opensips</span> <br>
                                  </div>
                                  <div>
                                    <div><br>
                                    </div>
                                    <div><span class="m_8230626994823735588gmail-hljs-selector-tag">real</span>    0<span class="m_8230626994823735588gmail-hljs-selector-tag">m1</span><span class="m_8230626994823735588gmail-hljs-selector-class" style="color:rgb(136,0,0)">.424s</span></div>
                                    <div><span class="m_8230626994823735588gmail-hljs-selector-class" style="color:rgb(136,0,0)">user</span> 
                                        0<span class="m_8230626994823735588gmail-hljs-selector-tag">m0</span><span class="m_8230626994823735588gmail-hljs-selector-class" style="color:rgb(136,0,0)">.004s</span></div>
                                    <div><span class="m_8230626994823735588gmail-hljs-selector-class" style="color:rgb(136,0,0)">sys</span> 
                                         0<span class="m_8230626994823735588gmail-hljs-selector-tag">m0</span><span class="m_8230626994823735588gmail-hljs-selector-class" style="color:rgb(136,0,0)">.000s</span></div>
                                  </div>
                                </div>
                              </div>
                              <br>
                              <b><font color="#274e13">I pulled source
                                  from master.</font></b><br>
                            </div>
                            <div><br>
                            </div>
                            <div>
                              <div class="m_8230626994823735588gmail-hljs m_8230626994823735588gmail-ruby" style="display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248);font-family:monospace">
                                <div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">#
                                      time systemctl start opensips </span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">Oct 
                                      2 15:57:41 srouter-215 systemd[1]:
                                      Starting OpenSIPS is a very fast
                                      and flexible SIP (RFC3261)
                                      server... </span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">Oct 
                                      2 15:57:41 srouter-215
                                      opensips[15906]: Listening on </span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">Oct 
                                      2 15:57:41 srouter-215
                                      opensips[15906]: udp: x.x.x.x
                                      [x.x.x.x]:9020 </span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">Oct 
                                      2 15:57:41 srouter-215
                                      opensips[15906]: udp:
                                      x6:x6:x6:x6:x6:x6 [[x6:x6:0:0:x6:x6:x6:x6]]:9020 </span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">Oct 
                                      2 15:57:41 srouter-215
                                      opensips[15906]: Aliases: </span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">Oct 
                                      2 15:57:41 srouter-215
                                      opensips[15906]: *: x.x.x.x:* </span></div>
                                  <div><br>
                                  </div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">real 
                                        0m0.066s</span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">user 
                                        0m0.003s</span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">sys 
                                         0m0.002s</span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">root<span class="m_8230626994823735588gmail-hljs-doctag" style="font-weight:bold">@srouter</span>-215:~#
                                      Oct  2 15:57:41 srouter-215
                                      systemd[1]: Started OpenSIPS is a
                                      very fast and flexible SIP
                                      (RFC3261) server. </span></div>
                                </div>
                              </div>
                            </div>
                            <div dir="ltr"><br>
                            </div>
                            <div>/var/log/opensips.log is here ... <a href="https://pastebin.com/8md6sBiP" target="_blank">https://pastebin.com/8md6sBiP</a></div>
                            <div dir="ltr"><br>
                            </div>
                            <div>
                              <div class="m_8230626994823735588gmail-hljs m_8230626994823735588gmail-apache" style="display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248);font-family:monospace">
                                <div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">#
                                      time opensipsctl fifo
                                      reload_blacklist</span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">WARNING:
                                      database engine not found - tried
                                      'MYSQL'</span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">Oct 
                                      2 16:17:24 srouter-215
                                      SIPSrv[16185]:
                                      <a class="m_8230626994823735588moz-txt-link-freetext">INFO:userblacklist:reload_sources</a>:
                                      got 1386901 entries from
                                      'globalblacklist' </span></div>
                                  <div><br>
                                  </div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">real 
                                        0m41.551s</span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">user 
                                        0m0.037s</span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-comment" style="color:rgb(136,136,136)">sys 
                                         0m0.015s</span></div>
                                </div>
                              </div>
                            </div>
                            <br>
                            <div>
                              <div class="m_8230626994823735588gmail-hljs m_8230626994823735588gmail-css" style="display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248);font-family:monospace">
                                <div>
                                  <div># <span class="m_8230626994823735588gmail-hljs-selector-tag">time</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">systemctl</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">stop</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">opensips</span> </div>
                                  <div><span class="m_8230626994823735588gmail-hljs-selector-tag">Oct</span>  2 16<span class="m_8230626994823735588gmail-hljs-selector-pseudo" style="color:rgb(188,96,96)">:06</span><span class="m_8230626994823735588gmail-hljs-selector-pseudo" style="color:rgb(188,96,96)">:38</span>
                                    <span class="m_8230626994823735588gmail-hljs-selector-tag">srouter-215</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">systemd</span><span class="m_8230626994823735588gmail-hljs-selector-attr" style="color:rgb(188,96,96)">[1]</span>:
                                    <span class="m_8230626994823735588gmail-hljs-selector-tag">Stopping</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">OpenSIPS</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">is</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">a</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">very</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">fast</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">and</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">flexible</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">SIP</span> (<span class="m_8230626994823735588gmail-hljs-selector-tag">RFC3261</span>) <span class="m_8230626994823735588gmail-hljs-selector-tag">server</span>... </div>
                                  <div><span class="m_8230626994823735588gmail-hljs-selector-tag">Oct</span>  2 16<span class="m_8230626994823735588gmail-hljs-selector-pseudo" style="color:rgb(188,96,96)">:06</span><span class="m_8230626994823735588gmail-hljs-selector-pseudo" style="color:rgb(188,96,96)">:50</span>
                                    <span class="m_8230626994823735588gmail-hljs-selector-tag">srouter-215</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">systemd</span><span class="m_8230626994823735588gmail-hljs-selector-attr" style="color:rgb(188,96,96)">[1]</span>:
                                    <span class="m_8230626994823735588gmail-hljs-selector-tag">Stopped</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">OpenSIPS</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">is</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">a</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">very</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">fast</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">and</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">flexible</span> <span class="m_8230626994823735588gmail-hljs-selector-tag">SIP</span> (<span class="m_8230626994823735588gmail-hljs-selector-tag">RFC3261</span>) <span class="m_8230626994823735588gmail-hljs-selector-tag">server</span>. </div>
                                  <div><br>
                                  </div>
                                  <div><span class="m_8230626994823735588gmail-hljs-selector-tag">real</span>    0<span class="m_8230626994823735588gmail-hljs-selector-tag">m12</span><span class="m_8230626994823735588gmail-hljs-selector-class" style="color:rgb(136,0,0)">.134s</span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-selector-class" style="color:rgb(136,0,0)">user</span> 
                                      0<span class="m_8230626994823735588gmail-hljs-selector-tag">m0</span><span class="m_8230626994823735588gmail-hljs-selector-class" style="color:rgb(136,0,0)">.003s</span></div>
                                  <div><span class="m_8230626994823735588gmail-hljs-selector-class" style="color:rgb(136,0,0)">sys</span> 
                                       0<span class="m_8230626994823735588gmail-hljs-selector-tag">m0</span><span class="m_8230626994823735588gmail-hljs-selector-class" style="color:rgb(136,0,0)">.002s</span></div>
                                </div>
                                <div><br>
                                </div>
                              </div>
                            </div>
                            <br>
                            <div>
                              <div>Looks like issue has been fixed.. :)</div>
                            </div>
                            <div><br>
                            </div>
                            <div>
                              <div>
                                <div dir="ltr" class="m_8230626994823735588gmail_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>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Tue, 2 Oct 2018 at 18:55, Bogdan-Andrei Iancu
          <<a href="mailto:bogdan@opensips.org" target="_blank">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>OK, I pushed on
              master a patch to move the initial data load after the
              startup sequence. The patch should apply to 2.4 also.  <br>
              <br>
                 
              <a class="m_8230626994823735588m_-8755737668942482938moz-txt-link-freetext" href="https://github.com/OpenSIPS/opensips/commit/32cba1d751ee5a5b705da97ac4333fcad3d67728" target="_blank">https://github.com/OpenSIPS/opensips/commit/32cba1d751ee5a5b705da97ac4333fcad3d67728</a><br>
              <br>
              While checking the module, I found some issues with it:<br>
              <br>
                  * before my patch, the load (for same data) was
              independently done in each opensips process (even if the
              data is shared) :)<br>
              <br>
                  * the "reload" is no error pron - if the new data load
              fails, the old existing data is lost<br>
              <br>
                  * during the data reload the module has no data, so it
              cannot operate (it will actually block) - normally it
              should continue with the old data until the new data is
              fully loaded and validated.<br>
              <br>
              Let me know if the patch makes a different for you and I
              will backport it to 2.4 too.<br>
              <br>
              Regards,<br>
            </tt>
            <pre class="m_8230626994823735588m_-8755737668942482938moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="m_8230626994823735588m_-8755737668942482938moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a>
OpenSIPS Bootcamp 2018
  <a class="m_8230626994823735588m_-8755737668942482938moz-txt-link-freetext" href="http://opensips.org/training/OpenSIPS_Bootcamp_2018/" target="_blank">http://opensips.org/training/OpenSIPS_Bootcamp_2018/</a>
</pre>
            <div class="m_8230626994823735588m_-8755737668942482938moz-cite-prefix">On
              10/02/2018 04:18 PM, Bogdan-Andrei Iancu wrote:<br>
            </div>
            <blockquote type="cite"> <tt>Hi,<br>
                <br>
                Taking a closer look at the module (to be honest I do
                not user it, as drouting does a similar job) I see the
                module is loading the data into memory. It is doing this
                during the init stage, holding back the entire OpenSIPS
                startup. <br>
                Module doing similar heavy db load were changed to do
                the load post-startup. Let patch the module to decouple
                the loading from the startup, so that OpenSIPS will
                start without delays.<br>
                <br>
                Regards,<br>
              </tt>
              <pre class="m_8230626994823735588m_-8755737668942482938moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="m_8230626994823735588m_-8755737668942482938moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a>
OpenSIPS Bootcamp 2018
  <a class="m_8230626994823735588m_-8755737668942482938moz-txt-link-freetext" href="http://opensips.org/training/OpenSIPS_Bootcamp_2018/" target="_blank">http://opensips.org/training/OpenSIPS_Bootcamp_2018/</a>
</pre>
              <div class="m_8230626994823735588m_-8755737668942482938moz-cite-prefix">On
                10/02/2018 04:04 PM, Jon Abrams wrote:<br>
              </div>
              <blockquote type="cite">
                <div dir="ltr">
                  <div>OpenSIPs is loading the global blacklist into a
                    digit trie structure into shared memory on startup
                    (or reload_blacklist command). That causes the
                    startup delay.</div>
                  <div><br>
                  </div>
                  <div>- Jon<br>
                  </div>
                </div>
                <br>
                <div class="gmail_quote">
                  <div dir="ltr">On Tue, Oct 2, 2018 at 7:55 AM Abdul
                    Basit <<a href="mailto:basit.engg@gmail.com" target="_blank">basit.engg@gmail.com</a>>
                    wrote:<br>
                  </div>
                  <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">Hi Bogdan,
                          <div><br>
                          </div>
                          <div>I don't think so its translating to DB
                            query on run time, instead its caching the
                            blacklist.</div>
                          <div>I am saying so because opensips response
                            is quick, where as when I query manually
                            from DB, it take some time even prefix col.
                            is indexed.<br>
                            <div>Moreover, while opensips restart i get
                              following warnings in syslog: </div>
                            <div><br>
                            </div>
                            <br>
                          </div>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                </div>
              </blockquote>
            </blockquote>
            <br>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div>