<div dir="ltr">Thanks for the input Bogdan.<div><br></div><div>We found that the problem was due to some calls failing to get the response.</div><div><br></div><div>Since we had the dialog timeout of 6 hours, which was not in sync with application logic, we were sending more calls than available destinations.</div><div><br></div><div>We have updated the dialog timeout in par with the application and this should resolve the issue for us.</div><div><br></div><div>Regards,</div><div>Chandan</div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 17, 2016 at 3:15 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span> wrote:<br><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 Chandan,<br>
<br>
Could you check what is the status of the calls (see the "State"
field) ? I guess the call are listed in state 5 (terminated) - and
this is the reason why you do not see them as counted by LB.<br>
<br>
Regards,<br>
</tt>
<pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<wbr>com</a></pre><div><div class="h5">
<div>On 16.08.2016 12:47, Chandan PR wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
<div dir="ltr">Hi Guys,
<div><br>
</div>
<div>Opendsips Version : 1.9.x</div>
<div><br>
</div>
<div>We have configured the load balancer with 8 ports.</div>
<div><br>
</div>
<div>When the calls are ongoing, the lb_list shows the load
balancer is running full.</div>
<div><br>
</div>
<div>
<div>root@Dev-Chandan-Opensips-LB:/<wbr>usr/local/opensips/sbin#
./opensipsctl fifo lb_list</div>
<div>Destination:: sip:<a href="http://192.168.248.62:5060" target="_blank">192.168.248.62:5060</a>
id=152 group=1 enabled=yes auto-re=on</div>
<div><span style="white-space:pre-wrap">        </span>Resource::
channel max=4 load=4</div>
<div>Destination:: sip:<a href="http://192.168.248.64:5060" target="_blank">192.168.248.64:5060</a>
id=153 group=1 enabled=yes auto-re=on</div>
<div><span style="white-space:pre-wrap">        </span>Resource::
channel max=4 load=4</div>
<div><br>
</div>
<div>When I check the dialog_list, I see some older dialogs
which are yet to be cleared.</div>
<div><br>
</div>
<div>root@Dev-Chandan-Opensips-LB:/<wbr>usr/local/opensips/sbin#
./opensipsctl fifo dlg_list | grep "callid"</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610041471339775929_<wbr>ZTLT_931</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610151471339775929_<wbr>ZTLT_937</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610221471339775929_<wbr>ZTLT_942</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610081471339775929_<wbr>ZTLT_933</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610181471339775929_<wbr>ZTLT_939</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610191471339775929_<wbr>ZTLT_940</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610131471339775929_<wbr>ZTLT_936</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610031471339775929_<wbr>ZTLT_930</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610061471339775929_<wbr>ZTLT_932</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610161471339775929_<wbr>ZTLT_938</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610271471339775929_<wbr>ZTLT_945</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610371471339775929_<wbr>ZTLT_951</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610101471339775929_<wbr>ZTLT_934</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610311471339775929_<wbr>ZTLT_947</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610211471339775929_<wbr>ZTLT_941</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610241471339775929_<wbr>ZTLT_943</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610341471339775929_<wbr>ZTLT_949</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610011471339775929_<wbr>ZTLT_929</div>
<div><span style="white-space:pre-wrap">        </span>callid::
14713396610111471339775929_<wbr>ZTLT_935</div>
<div>root@Dev-Chandan-Opensips-LB:/<wbr>usr/local/opensips/sbin#
./opensipsctl fifo dlg_list | grep "callid" | wc -l</div>
<div>13</div>
<div>root@Dev-Chandan-Opensips-LB:/<wbr>usr/local/opensips/sbin# </div>
</div>
<div><br>
</div>
<div><b>Even when the lb_list shows the load as 0, I see some
dialogs present and getting cleared after around 10-12
seconds.</b></div>
<div><br>
</div>
<div>What would be the impact of this delay in clearing the
dialogs? Can this lead to lot many calls rejected with
"Destination Full" (We are experiencing this issue in our
production, where a huge number of calls rejected)?</div>
<div><br>
</div>
<div>Is there any way to reduce this delay or clear the dialogs
immediately?</div>
<div><br>
</div>
<div><b><u>Dialog Module Settings:</u></b></div>
<div>
<div>#### DIALOG module</div>
<div>loadmodule "dialog.so"</div>
<div>modparam("dialog", "dlg_match_mode", 1)</div>
<div>modparam("dialog", "default_timeout", 21600) #
6 hours timeout</div>
<div>modparam("dialog", "db_mode", 2)</div>
<div>modparam("dialog", "db_url",</div>
<div><span style="white-space:pre-wrap">        </span>"mysql://opensips:opensipsrw@<wbr>localhost/opensips")
#</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><b><u>Load Balancer Script:</u></b></div>
<div>
<div>#</div>
<div># $Id: opensips_loadbalancer.m4 9723 2013-02-01 15:10:50Z
bogdan_iancu $</div>
<div>#</div>
<div># OpenSIPS loadbalancer script</div>
<div># by OpenSIPS Solutions <<a href="mailto:team@opensips-solutions.com" target="_blank">team@opensips-solutions.com</a>></div>
<div>#</div>
<div># This script was generated via "make menuconfig", from</div>
<div># the "Load Balancer" scenario.</div>
<div># You can enable / disable more features /
functionalities by</div>
<div># re-generating the scenario with different options.</div>
<div>#</div>
<div># Please refer to the Core CookBook at:</div>
<div># <a href="http://www.opensips.org/Resources/DocsCookbooks" target="_blank">http://www.opensips.org/<wbr>Resources/DocsCookbooks</a></div>
<div># for a explanation of possible statements, functions and
parameters.</div>
<div>#</div>
<div><br>
</div>
<div><br>
</div>
<div>####### Global Parameters #########</div>
<div><br>
</div>
<div>debug=3</div>
<div>log_stderror=no</div>
<div>log_facility=LOG_LOCAL1</div>
<div><br>
</div>
<div>fork=yes</div>
<div>children=4</div>
<div><br>
</div>
<div>/* uncomment the following lines to enable debugging */</div>
<div>#debug=6</div>
<div>#fork=no</div>
<div>#log_stderror=yes</div>
<div><br>
</div>
<div>/* uncomment the next line to enable the auto temporary
blacklisting of </div>
<div> not available destinations (default disabled) */</div>
<div>#disable_dns_blacklist=no</div>
<div><br>
</div>
<div>/* uncomment the next line to enable IPv6 lookup after
IPv4 dns </div>
<div> lookup failures (default disabled) */</div>
<div>#dns_try_ipv6=yes</div>
<div><br>
</div>
<div>/* comment the next line to enable the auto discovery of
local aliases</div>
<div> based on revers DNS on IPs */</div>
<div>auto_aliases=no</div>
<div><br>
</div>
<div><br>
</div>
<div>listen=udp:<a href="http://192.168.248.111:5060" target="_blank">192.168.248.111:<wbr>5060</a>
# CUSTOMIZE ME</div>
<div><br>
</div>
<div>disable_tcp=no</div>
<div>listen=tcp:<a href="http://192.168.248.111:5060" target="_blank">192.168.248.111:<wbr>5060</a>
# CUSTOMIZE ME </div>
<div><br>
</div>
<div>disable_tls=yes</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>####### Modules Section ########</div>
<div><br>
</div>
<div>#set module path</div>
<div>mpath="/usr/local/opensips/<wbr>lib64/opensips/modules/"</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>#### SIGNALING module</div>
<div>loadmodule "signaling.so"</div>
<div><br>
</div>
<div>#### StateLess module</div>
<div>loadmodule "sl.so"</div>
<div><br>
</div>
<div>#### Transaction Module</div>
<div>loadmodule "tm.so"</div>
<div>modparam("tm", "fr_timer", 30)</div>
<div>modparam("tm", "fr_inv_timer", 120)</div>
<div>modparam("tm", "restart_fr_on_each_reply", 0)</div>
<div>modparam("tm", "onreply_avp_mode", 1)</div>
<div><br>
</div>
<div>#### Record Route Module</div>
<div>loadmodule "rr.so"</div>
<div>/* do not append from tag to the RR (no need for this
script) */</div>
<div>modparam("rr", "append_fromtag", 0)</div>
<div><br>
</div>
<div>#### MAX ForWarD module</div>
<div>loadmodule "maxfwd.so"</div>
<div><br>
</div>
<div>#### SIP MSG OPerationS module</div>
<div>loadmodule "sipmsgops.so"</div>
<div><br>
</div>
<div>#### FIFO Management Interface</div>
<div>loadmodule "mi_fifo.so"</div>
<div>modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")</div>
<div>modparam("mi_fifo", "fifo_mode", 0666)</div>
<div><br>
</div>
<div>#### URI module</div>
<div>loadmodule "uri.so"</div>
<div>modparam("uri", "use_uri_table", 0)</div>
<div><br>
</div>
<div>#### MYSQL module</div>
<div>loadmodule "db_mysql.so"</div>
<div><br>
</div>
<div>#### AVPOPS module</div>
<div>loadmodule "avpops.so"</div>
<div><br>
</div>
<div>#### ACCounting module</div>
<div>loadmodule "acc.so"</div>
<div>/* what special events should be accounted ? */</div>
<div>modparam("acc", "early_media", 0)</div>
<div>modparam("acc", "report_cancels", 0)</div>
<div>/* by default we do not adjust the direct of the
sequential requests.</div>
<div> if you enable this parameter, be sure the enable
"append_fromtag"</div>
<div> in "rr" module */</div>
<div>modparam("acc", "detect_direction", 0)</div>
<div>modparam("acc", "failed_transaction_flag", "ACC_FAILED")</div>
<div>/* account triggers (flags) */</div>
<div>modparam("acc", "log_flag", "ACC_DO")</div>
<div>modparam("acc", "log_missed_flag", "ACC_MISSED")</div>
<div><br>
</div>
<div><br>
</div>
<div>#### DIALOG module</div>
<div>loadmodule "dialog.so"</div>
<div>modparam("dialog", "dlg_match_mode", 1)</div>
<div>modparam("dialog", "default_timeout", 21600) # 6 hours
timeout</div>
<div>modparam("dialog", "db_mode", 2)</div>
<div>modparam("dialog", "db_url",</div>
<div><span style="white-space:pre-wrap">        </span>"mysql://opensips:opensipsrw@<wbr>localhost/opensips")
# CUSTOMIZE ME</div>
<div><br>
</div>
<div><br>
</div>
<div>#### LOAD BALANCER module</div>
<div>loadmodule "load_balancer.so"</div>
<div>modparam("load_balancer", "db_url",</div>
<div><span style="white-space:pre-wrap">        </span>"mysql://opensips:opensipsrw@<wbr>localhost/opensips")
# CUSTOMIZE ME</div>
<div>modparam("load_balancer", "probing_method", "OPTIONS")</div>
<div><br>
</div>
<div>modparam("load_balancer", "probing_interval", 15)</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>####### Routing Logic ########</div>
<div><br>
</div>
<div><br>
</div>
<div># main request routing logic</div>
<div>route{</div>
<div><span style="white-space:pre-wrap">        </span>if
(!mf_process_maxfwd_header("3"<wbr>)) {</div>
<div><span style="white-space:pre-wrap">                </span>send_reply("483","looping");</div>
<div><span style="white-space:pre-wrap">                </span>exit;</div>
<div><span style="white-space:pre-wrap">        </span>}</div>
<div><br>
</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap">        </span>if (
has_totag() ) {</div>
<div><span style="white-space:pre-wrap">                </span>#
sequential request -> obey Route indication</div>
<div><span style="white-space:pre-wrap">                </span>xlog("Loose
Route for $avp(iurl) over $avp(dest) $avp(calltype) \n");</div>
<div><span style="white-space:pre-wrap">                </span>loose_route();</div>
<div> t_relay();</div>
<div> exit;</div>
<div> }</div>
<div><br>
</div>
<div> # handle cancel and re-transmissions</div>
<div><span style="white-space:pre-wrap">        </span>if (
is_method("CANCEL") ) {</div>
<div><span style="white-space:pre-wrap">                </span>if (
t_check_trans() )</div>
<div><span style="white-space:pre-wrap">                        </span>t_relay();</div>
<div><span style="white-space:pre-wrap">                </span>exit;</div>
<div><span style="white-space:pre-wrap">        </span>}</div>
<div><br>
</div>
<div><br>
</div>
<div> # from now on we have only the initial requests</div>
<div> if (!is_method("INVITE")) {</div>
<div> send_reply("405","Method Not Allowed");</div>
<div> exit;</div>
<div> }</div>
<div><br>
</div>
<div> # initial request</div>
<div><span style="white-space:pre-wrap">        </span>record_route();</div>
<div><span style="white-space:pre-wrap">        </span>$avp(iurl)
= $(hdr(P-Nuance-Initial-URL));</div>
<div><span style="white-space:pre-wrap">        </span>$avp(calltype)
= $(hdr(P-Nuance-Call-Type));</div>
<div> xlog("Sending call $fu $avp(iurl) $avp(calltype)
\n");<span style="white-space:pre-wrap">        </span></div>
<div><span style="white-space:pre-wrap">        </span>xlog("Current
Dialogs count $DLG_count \n");</div>
<div><span style="white-space:pre-wrap">        </span># LB
function returns negative if no suitable destination (for
requested resources) is found,</div>
<div> # or if all destinations are full</div>
<div> if ( !load_balance("1","channel") ) {</div>
<div><span style="white-space:pre-wrap">        </span>
xlog("All Destinations are full. Sending 500! $fu
$(hdr(P-Nuance-Initial-URL)) CURRENT DIALOGS $DLG_count
\n");</div>
<div> send_reply("500","Service full");</div>
<div> exit;</div>
<div> }</div>
<div><span style="white-space:pre-wrap">        </span>$avp(dest)
= $du;</div>
<div><span style="white-space:pre-wrap">        </span>xlog("Call
sent over $avp(dest) $fu $(hdr(P-Nuance-Initial-URL))\<wbr>n");</div>
<div><span style="white-space:pre-wrap">        </span>t_on_reply("test");</div>
<div> # arm a failure route for be able to catch a
failure event and to do </div>
<div> # failover to the next available destination</div>
<div> t_on_failure("LB_failed");</div>
<div><br>
</div>
<div> # send it out</div>
<div><span style="white-space:pre-wrap">        </span>if
(!t_relay()) {</div>
<div><span style="white-space:pre-wrap">                </span>sl_reply_error();</div>
<div><span style="white-space:pre-wrap">        </span>}</div>
<div><br>
</div>
<div>}</div>
<div><br>
</div>
<div>#onreply_route {</div>
<div>#<span style="white-space:pre-wrap">        </span>xlog("OpenSIPS
received a reply $avp(iurl) rs= $rs | fu= $fu | si= $si |
Ri= $Ri ===");</div>
<div>#}</div>
<div><br>
</div>
<div>onreply_route[test] {</div>
<div><span style="white-space:pre-wrap">        </span>xlog("Reply
$rs received from $si for the call $avp(iurl)");</div>
<div>}</div>
<div><br>
</div>
<div>failure_route[LB_failed]</div>
<div>{</div>
<div> # skip if call was canceled </div>
<div><span style="white-space:pre-wrap">        </span>if
(t_was_cancelled()) {</div>
<div><span style="white-space:pre-wrap">                </span>exit;</div>
<div><span style="white-space:pre-wrap">        </span>}</div>
<div><span style="white-space:pre-wrap">        </span>xlog("Call
$avp(iurl) sent over $avp(dest) failed with code
$T_reply_code\n");</div>
<div> </div>
<div><span style="white-space:pre-wrap">        </span># Checking
only for Destination Failure</div>
<div><span style="white-space:pre-wrap">        </span># If the
destination is failed, disable it and reroute the call</div>
<div> #if ( t_check_status("[56][0-9][0-9]<wbr>")) {</div>
<div> if ( t_check_status("503")) {</div>
<div><span style="white-space:pre-wrap">        </span> #
this is a case for failover</div>
<div> xlog("Marking $avp(dest) disabled as it
failed for call $avp(iurl) with code $T_reply_code\n");</div>
<div> #xlog("call $avp(iurl) failed with code
$T_reply_code from $avp(dest)\n");</div>
<div><span style="white-space:pre-wrap">                </span># mark
failed destination as disabled </div>
<div> lb_disable();</div>
<div> # try to re-route to next available
destination</div>
<div> #if ( !load_balance("1","channel") ) {</div>
<div><span style="white-space:pre-wrap">                </span>#
xlog("RETRY FAILED SENDING 500");<span style="white-space:pre-wrap">        </span></div>
<div> # send_reply("500","Service Full");</div>
<div> # exit;</div>
<div> #}</div>
<div> #xlog("REPORT: re-routing call to $du
\n");</div>
<div> #t_relay();</div>
<div> }</div>
<div><span style="white-space:pre-wrap">        </span>send_reply("$T_reply_code","<wbr>Call
Failed");</div>
<div>}</div>
<div><br>
</div>
</div>
<div><br>
</div>
<div>Regards,</div>
<div>Chandan</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>______________________________<wbr>_________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div><br></div></div></div>