<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    On 11/15/11 10:09 PM, Javier Gallart wrote:
    <blockquote
cite="mid:CACviLGaiNV9ezZ9T8V1Jwb37Fe1JczovxUFs=nZGdGii5LdGNw@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello<br>
          <br>
          coming back to the topic related to mtree, to be able to set
          values via<br>
          mi/rpc -- it won't be that difficult to add such
          functionality. Usually<br>
          with a tree is mainly reading, due to fast matching on tree
          indexing.<br>
          The question is how many times/often do you need to change
          values and<br>
          how many of them at the same time (more or less).<br>
          <br>
        </blockquote>
        <div>I was also thinking about that: our application works in
          such a way that the full tree is recalculated every 15
          minutes. Currently we have aound 60 branches with 150000
          entries each.</div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex;">
          I assume many times the changes will be somewhere down the
          tree, since<br>
          the first part of the number is usually the same (e.g.,
          country code and<br>
          operator prefix). To update the tree at runtime, while there
          are reads<br>
          on it, there must be used a lock to be safe an consistent. If
          you do lot<br>
          of writes and very often, then you keep the tree structure
          locked a lot,<br>
          slowing the search.<br>
        </blockquote>
        <div><br>
        </div>
        <div>That's the case, tname is rarely updated, it's tvalue the
          column that we normally update.</div>
      </div>
    </blockquote>
    <br>
    I guess you meant actually tprefix is not updated -- tname is table
    name, tprefix is the prefix used to build the tree. What would be
    the percentage of tvalue updates, do you have add/remove of
    tprefix-es?<br>
    <br>
    <blockquote
cite="mid:CACviLGaiNV9ezZ9T8V1Jwb37Fe1JczovxUFs=nZGdGii5LdGNw@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex;">
          <br>
          Can you estimate the number of writes and how often they would
          be on a<br>
          daily basis? There might be other solutions to look at, if
          writes are<br>
          very often.<br>
        </blockquote>
        <div><br>
        </div>
        <div>From the numbers above, let's say that we need to update
          around 8M records every 15 minutes (we expect this number will
          keep steadily increasing...)</div>
      </div>
    </blockquote>
    <br>
    But not all of them change the value, right?<br>
    <br>
    <blockquote
cite="mid:CACviLGaiNV9ezZ9T8V1Jwb37Fe1JczovxUFs=nZGdGii5LdGNw@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">
        <div><br>
        </div>
        <div>As a side note, I've looked at how to implement the
          mt_match equivalent in redis and it does't look that hard
          using kamailio s.prefixed transformation (as you suggested)
          and redis sorted sets. I'll need to make more tests to check
          the performance, I'll share the results.</div>
      </div>
    </blockquote>
    <br>
    I have used this solution with mysql (using a table structure in
    memory of mysql server), since the changes could have been done in
    mysql in normal way, in one update query, which is a sync operation.
    Does redis do any caching or is using always the disk file db?<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <blockquote
cite="mid:CACviLGaiNV9ezZ9T8V1Jwb37Fe1JczovxUFs=nZGdGii5LdGNw@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">
        <div><br>
        </div>
        <div>Thanks!</div>
        <div><br>
        </div>
        <div>Javi&nbsp;</div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex;">
          <br>
          Cheers,<br>
          Daniel<br>
          &gt;<br>
          &gt; Regards<br>
          &gt;<br>
          &gt; Javi<br>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Dec 5-8, Berlin: <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
  </body>
</html>