<p>I was confused a little while using dispatcher weight alg. Smth like this If some host go away:<br>
30/30/40 -> 70/30/0 (the third one was failed). This transformation is more correct in my mind:<br>
30/30/40 -> 50/50/0. So I have to assign some hook to dispatcher:dst-down/dispatcher:dst-up  route for rebalancing<br>
“rweight” (relative weight)  parameter is added in this branch. rweight is in the integer range from 1 to 100 (weight, not percentage).<br>
Active host usage probability is  rweight/(sum of all active host rweights in destination group).<br>
So INACTIVE/DISABLED destinations are removed from probability calculation.<br>
let’s we have rweights 1/2/1; 100 calls will be distributed as  25/50/25<br>
after third host failing (via ds_mark_dst([state]) or RPC dispatcher.set_state or via module pinging): 33/67/0 </p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/kamailio/kamailio/pull/219'>https://github.com/kamailio/kamailio/pull/219</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>dispatcher: relative weight distribution added</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/219/files#diff-0">modules/dispatcher/dispatch.c</a>
    (134)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/219/files#diff-1">modules/dispatcher/dispatch.h</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/219/files#diff-2">modules/dispatcher/dispatcher.c</a>
    (3)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/kamailio/kamailio/pull/219.patch'>https://github.com/kamailio/kamailio/pull/219.patch</a></li>
  <li><a href='https://github.com/kamailio/kamailio/pull/219.diff'>https://github.com/kamailio/kamailio/pull/219.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/pull/219">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36Za_sgRGW2lHN_EYP9zT6Myt3OdE5ks5oVxp8gaJpZM4FIcFS.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/kamailio/kamailio/pull/219"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>