<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<tt>Hi, Dhaval!<br>
<br>
A use case for this algorithm is setting the pv_algo_pattern as
shown in the documentation page[1]:<br>
modparam("dispatcher", "pvar_algo_pattern", "$stat(load_%u)")<br>
<br>
This parameter indicates that whenever you are using a
ds_select_*() function with algorithm 9, OpenSIPS will check the
load for each destination, and order them based on each value.<br>
For example, consider we have two destinations: sip:1.1.1.1 and
sip:2.2.2.2. Algorithm 9 will evaluate for each destination the
following pvars:<br>
$stat(load_sip:1.1.1.1) and $stat(load_sip:2.2.2.2) and order them
based on its values. Then of course, first picks the least used
one.<br>
<br>
All that's left for you is to update the statistic accordingly.
For example:<br>
<br>
if (ds_select_dst("0", "9"))<br>
update_stat("load_sip:$dd", "+1");<br>
<br>
Hope that's clear now.<br>
</tt><tt>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<br>
[1]
<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/2.1.x/dispatcher#id293975">http://www.opensips.org/html/docs/modules/2.1.x/dispatcher#id293975</a><br>
<br>
Best regards,</tt><br>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 12/18/2015 01:05 PM, DHAVAL
INDRODIYA wrote:<br>
</div>
<blockquote
cite="mid:CAE8gfe8hLfNo+=bSroSPNchyNsMAKj3aLsnjhRcie2U_nckYtg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_default"
style="font-family:verdana,sans-serif;color:rgb(0,0,0)">Dear
All,<br>
<br>
</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif;color:rgb(0,0,0)">I am
working on opensips dispatcher and found that dispatcher is
able to do loadbalancing in function ds_select_dst.<br>
<br>
</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif;color:rgb(0,0,0)">I have
found a good description on DISPATCHER module itself it says
- " <b>The <span class=""><em>pvar_algo_pattern</em></span>
parameter is used to determine the load on each server. If
the parameter is not specified, then the first entry in the
set is chosen.</b>"<br>
<br>
</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif;color:rgb(0,0,0)">Now
the question here is how to use this load balancing and what
should be exact value we need to put in pvar_algo_pattern?<br>
<br>
How to define weight in table I mean what should be value of
weight in table it is like number of call handling capability?<br>
<br>
</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif;color:rgb(0,0,0)">I have
found some of the reference and that some how not working i
might be using in wrong way if any one have a good example
then would be a great help for me.</div>
<br>
<div class="gmail_default"
style="font-family:verdana,sans-serif;color:rgb(0,0,0)">BR,<br>
</div>
<div class="gmail_default"
style="font-family:verdana,sans-serif;color:rgb(0,0,0)">DI</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>