<div dir="ltr">Thank you for your response!<div><br></div><div>I am currently replacing the call_control module used with CDRTool Prepaid with the dialog module using hash tables. The speed and stability are tremendously better!<br><div><br></div><div>My concern is two-fold:<br></div><div>1) I do not want calls to be blocked because I set the hash table size too small.  </div><div>2) I do not want any memory usage problems that could cause kamailio stability issues.</div><div><br></div><div><div>My understanding, or at least how I want to use the "hash_size" modparam, is that hash_size gives dialog a set memory space (aka slots and buckets) to store the dialogs being tracked.  This is great since I "think" I will have constant memory consumption that will be a fixed amount and never "grow".  However, I wanted to get a rough idea of how many dialogs (customer calls) I could track per kamailio instance to properly choose the hash size.</div></div><div><br></div><div>I thought it would be easy to set the value to something very small in the lab and just run up the number of calls until kamailio hits an upper limit and fails to create any more dialogs. </div><div>modparam("dialog", "hash_size", 32)<br></div><div><br></div><div>However, I am able to create almost 2000 dialogs no matter what size I choose.  After, reading the information in the link about hash tables and your response, I see how a larger table with more "hashing" increases lookup performance, but I still do not see how the total number of dialogs that the module tracks can be set so that the kamailio memory usage is protected.  I still look at the hash_size as the key here and that there should be a relationship, perhaps rough at best, to the maximum number of dialogs supported in the table.</div><div><br></div><div>Thanks so much for your time,</div></div><div>Mark Blackord</div><div>Digium Cloud Services</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 2, 2017 at 2:50 AM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>hash size does not set any limitation to the number of dialogs
      (active calls), it has impact on searching the dialogs, so if you
      have a lot of active calls, increasing the hash size might improve
      performances. Effectively the hash size is used to compute the
      number of slots (aka buckets) the hash table is going to have, see
      more technical details about hash tables at:</p>
    <p>  - <a class="m_-8301622289956510289moz-txt-link-freetext" href="https://en.wikipedia.org/wiki/Hash_table" target="_blank">https://en.wikipedia.org/wiki/<wbr>Hash_table</a><br>
    </p>
    <p>Can you elaborate on your statement:</p><span class="">
    <p>> but even setting the hash size to a very tiny number does
      stop me from creating hundreds of dialogs</p>
    </span><p>Do you mean you are not able to create as many dialogs as you
      want?</p>
    <p>Cheers,<br>
      Daniel<br>
    </p><div><div class="h5">
    <br>
    <div class="m_-8301622289956510289moz-cite-prefix">On 01.12.17 19:54, Mark Blackford
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <div dir="ltr">Hello,
        <div><br>
        </div>
        <div>I am trying to properly size the use of the Dialog Module
          hash for our implementation using:</div>
        <div><br>
        </div>
        <div>modparam("dialog", "hash_size", <number that is power of
          two>)</div>
        <div><br>
        </div>
        <div>However, in my testing, I have been unable to figure out
          the relationship between the hash size and a number of dialogs
          I need to support.  I think the hash size is specifying a
          memory block in kB, but even setting the hash size to a very
          tiny number does stop me from creating hundreds of dialogs.</div>
        <div><br>
        </div>
        <div>Is there a way to determine a relationship between the hash
          size and a rough number of dialogs that would be expected?</div>
        <div><br>
        </div>
        <div>An example of a a dialog looks like this from kamctl:</div>
        <div><br>
        </div>
        <div>
          <div>[root@kamailio01 ~]# kamctl dialog show</div>
          <div>dialog memory records</div>
          <div>dialog::  hash=22:70</div>
          <div><span style="white-space:pre-wrap">        </span>state:: 4</div>
          <div><span style="white-space:pre-wrap">        </span>ref_count:: 2</div>
          <div><span style="white-space:pre-wrap">        </span>timestart::
            1512151205</div>
          <div><span style="white-space:pre-wrap">        </span>timeout:: 36083666</div>
          <div><span style="white-space:pre-wrap">        </span>callid:: <a href="mailto:0gQAAC8WAAACBAAALxYAAClws2wyL8GE%2BCSgRY7HIhmg9ZUIISZad46ntOPng3iPIcLaxzLFaytRTI7M0Bzz0g--@10.155.8.40" target="_blank">0gQAAC8WAAACBAAALxYAAClws2wyL8<wbr>GE+<wbr>CSgRY7HIhmg9ZUIISZad46ntOPng3i<wbr>PIcLaxzLFaytRTI7M0Bzz0g--@10.<wbr>155.8.40</a></div>
          <div><span style="white-space:pre-wrap">        </span>from_uri:: <a href="mailto:sip%3Ab53667d44239457fbc94fc2f4c4e25a6@sip.dcs-staging.net" target="_blank">sip:<wbr>b53667d44239457fbc94fc2f4c4e25<wbr>a6@sip.dcs-staging.net</a></div>
          <div><span style="white-space:pre-wrap">        </span>from_tag::
            10.155.8.40+1+689d7e5e+<wbr>8fcf481a</div>
          <div><span style="white-space:pre-wrap">        </span>caller_contact::
            <a class="m_-8301622289956510289moz-txt-link-freetext">sip:<wbr>43f0ae1480846185e8803f21e9f2b7<wbr>21@10.155.8.40:5060;transport=<wbr>udp</a></div>
          <div><span style="white-space:pre-wrap">        </span>caller_cseq:: 24115</div>
          <div><span style="white-space:pre-wrap">        </span>caller_route_set:: </div>
          <div><span style="white-space:pre-wrap">        </span>caller_bind_addr::
            udp:<a href="http://10.155.8.11:5060" target="_blank">10.155.8.11:5060</a></div>
          <div><span style="white-space:pre-wrap">        </span>callee_bind_addr::
            udp:<a href="http://10.155.8.11:5060" target="_blank">10.155.8.11:5060</a></div>
          <div><span style="white-space:pre-wrap">        </span>to_uri:: <a href="mailto:sip%3A2052773090@sip.dcs-staging.net" target="_blank">sip:2052773090@sip.dcs-<wbr>staging.net</a></div>
          <div><span style="white-space:pre-wrap">        </span>to_tag::
            sip+1+bdcd0004+2038f37c</div>
          <div><span style="white-space:pre-wrap">        </span>callee_contact::
            <a class="m_-8301622289956510289moz-txt-link-freetext">sip:<wbr>ca2013e84f10348a1cc825c12562bd<wbr>e7@10.155.8.40:5060;transport=<wbr>udp</a></div>
          <div><span style="white-space:pre-wrap">        </span>callee_cseq:: 0</div>
          <div><span style="white-space:pre-wrap">        </span>callee_route_set:: </div>
        </div>
        <div><br>
        </div>
        <div> </div>
        <div><br>
        </div>
        <div>
          <div>Thanks!</div>
          -- <br>
          <div class="m_-8301622289956510289gmail-m_2252680259820329684gmail_signature">
            <div dir="ltr">Mark Blackford
              <div>Digium Cloud Services</div>
              <div>678.230.8769</div>
              <div><br>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="m_-8301622289956510289mimeAttachmentHeader"></fieldset>
      <br>
      </div></div><pre>______________________________<wbr>_________________
Kamailio (SER) - Users Mailing List
<a class="m_-8301622289956510289moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a class="m_-8301622289956510289moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <pre class="m_-8301622289956510289moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="m_-8301622289956510289moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="m_-8301622289956510289moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - <a class="m_-8301622289956510289moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="m_-8301622289956510289moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
  </font></span></div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Mark Blackford<div>Digium Cloud Services</div><div>678.230.8769</div><div><br></div></div></div>
</div>