Re: [OpenSIPS-Users] OpenSips Load balancer. - Overcome limitations of Call Driven Load Balancing

2020-07-27 Thread Chandan PR
Hi Jon, and All

While I was thinking through this approach, one question popped up in my
thought.

Since we run on a full load most of the hours, even if we limit the number
of calls to the faulty destination, it is very much possible that call
drain can happen as the faulty destination errors out immediately.

The only option to make sure the faulty destination doesn't get any calls
is by disabling it right..

Let me know what you think.


On Fri, Jul 24, 2020 at 7:42 PM Jon Abrams  wrote:

> Hi Chandan,
>
> There may be something else purpose built for this, but you can use
> the dialog profiles to track and limit the port usage:
>
> set_dlg_profile("outcarrier","$avp(out_carrier_id)");
>
> if ($avp(out_max_call_limit) > 0)
> {
> set_dlg_profile("profile","$avp(out_qos_profile_id)");
> if
> (get_profile_size("profile","$avp(out_qos_profile_id)","$var(out_gw_count)"))
> {
> if ($var(out_gw_count)>$avp(out_max_call_limit))
> {
> xlog("LIMIT: Call $ci - Max call limit hit by
> $avp(src_addr) on QosProfile $avp(out_qos_profile_id) to gw
> $avp(out_gw_id)\n");
> return(-1);
> }
> }
> }
>
> On Fri, Jul 24, 2020 at 8:55 AM Chandan PR  wrote:
> >
> > Hello Everyone,
> >
> > Currently, we are using Open Sips Load balancer in Call Driven load
> balancing.
> >
> > Our scenario is as below:
> >
> > D - Total Destinations configured at OpenSips
> > P - No of Ports/Sessions Each Destination can handle concurrently
> > C - Total Capacity = D*P
> >
> > We have a Call Loader which loads calls to OpenSips at C and as when the
> result comes further calls get loaded.
> > For some reason, if any destination is not in the right state and sends
> error responses without accepting calls, this introduces a drain scenario.
> > In the drain scenario where all new calls are given to the faulty
> destination as it has more availability.
> >
> > We are currently handling this by
> >
> > Running the loader at 80% of C
> > Disabling the destination in Opensips if 75% of the calls fail for the
> particular destination (Attached loadbalancer.cfg file).
> >
> >
> > But even in this case, it is possible that may call error out as the
> destination is free and calls are loaded.
> >
> > We would like to avoid this scenario to the max possible extent by
> limiting the number of calls we send to this particular destination.
> >
> > Couple of options I see are as below:
> >
> > Wait for a brief period before sending the response to loader when the
> error happens
> > Make OpenSips aware of the destination capacity and adjust ports
> accordingly
> >
> > Write a custom script to poll destination capacity and use MI functions
> to adjust accordingly
> > Or is there any possibility to integrate similar to FreeSwitch driven
> routing
> >
> > Are there any other possibilities of adjusting the OpenSips capacity
> dynamically or make it limit the calls sent to the particular destination?
> >
> > --
> >
> > Regards,
> > Chandan Ravishankar
> > ___
> > Users mailing list
> > Users@lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


-- 

Regards,
Chandan Ravishankar 
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] OpenSips Load balancer. - Overcome limitations of Call Driven Load Balancing

2020-07-24 Thread Chandan PR
Thanks for the response Jon.
Let me have a look at it.

On Fri, Jul 24, 2020 at 7:42 PM Jon Abrams  wrote:

> Hi Chandan,
>
> There may be something else purpose built for this, but you can use
> the dialog profiles to track and limit the port usage:
>
> set_dlg_profile("outcarrier","$avp(out_carrier_id)");
>
> if ($avp(out_max_call_limit) > 0)
> {
> set_dlg_profile("profile","$avp(out_qos_profile_id)");
> if
> (get_profile_size("profile","$avp(out_qos_profile_id)","$var(out_gw_count)"))
> {
> if ($var(out_gw_count)>$avp(out_max_call_limit))
> {
> xlog("LIMIT: Call $ci - Max call limit hit by
> $avp(src_addr) on QosProfile $avp(out_qos_profile_id) to gw
> $avp(out_gw_id)\n");
> return(-1);
> }
> }
> }
>
> On Fri, Jul 24, 2020 at 8:55 AM Chandan PR  wrote:
> >
> > Hello Everyone,
> >
> > Currently, we are using Open Sips Load balancer in Call Driven load
> balancing.
> >
> > Our scenario is as below:
> >
> > D - Total Destinations configured at OpenSips
> > P - No of Ports/Sessions Each Destination can handle concurrently
> > C - Total Capacity = D*P
> >
> > We have a Call Loader which loads calls to OpenSips at C and as when the
> result comes further calls get loaded.
> > For some reason, if any destination is not in the right state and sends
> error responses without accepting calls, this introduces a drain scenario.
> > In the drain scenario where all new calls are given to the faulty
> destination as it has more availability.
> >
> > We are currently handling this by
> >
> > Running the loader at 80% of C
> > Disabling the destination in Opensips if 75% of the calls fail for the
> particular destination (Attached loadbalancer.cfg file).
> >
> >
> > But even in this case, it is possible that may call error out as the
> destination is free and calls are loaded.
> >
> > We would like to avoid this scenario to the max possible extent by
> limiting the number of calls we send to this particular destination.
> >
> > Couple of options I see are as below:
> >
> > Wait for a brief period before sending the response to loader when the
> error happens
> > Make OpenSips aware of the destination capacity and adjust ports
> accordingly
> >
> > Write a custom script to poll destination capacity and use MI functions
> to adjust accordingly
> > Or is there any possibility to integrate similar to FreeSwitch driven
> routing
> >
> > Are there any other possibilities of adjusting the OpenSips capacity
> dynamically or make it limit the calls sent to the particular destination?
> >
> > --
> >
> > Regards,
> > Chandan Ravishankar
> > ___
> > Users mailing list
> > Users@lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


-- 

Regards,
Chandan Ravishankar 
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] OpenSips Load balancer. - Overcome limitations of Call Driven Load Balancing

2020-07-24 Thread Jon Abrams
Hi Chandan,

There may be something else purpose built for this, but you can use
the dialog profiles to track and limit the port usage:

set_dlg_profile("outcarrier","$avp(out_carrier_id)");

if ($avp(out_max_call_limit) > 0)
{
set_dlg_profile("profile","$avp(out_qos_profile_id)");
if 
(get_profile_size("profile","$avp(out_qos_profile_id)","$var(out_gw_count)"))
{
if ($var(out_gw_count)>$avp(out_max_call_limit))
{
xlog("LIMIT: Call $ci - Max call limit hit by
$avp(src_addr) on QosProfile $avp(out_qos_profile_id) to gw
$avp(out_gw_id)\n");
return(-1);
}
}
}

On Fri, Jul 24, 2020 at 8:55 AM Chandan PR  wrote:
>
> Hello Everyone,
>
> Currently, we are using Open Sips Load balancer in Call Driven load balancing.
>
> Our scenario is as below:
>
> D - Total Destinations configured at OpenSips
> P - No of Ports/Sessions Each Destination can handle concurrently
> C - Total Capacity = D*P
>
> We have a Call Loader which loads calls to OpenSips at C and as when the 
> result comes further calls get loaded.
> For some reason, if any destination is not in the right state and sends error 
> responses without accepting calls, this introduces a drain scenario.
> In the drain scenario where all new calls are given to the faulty destination 
> as it has more availability.
>
> We are currently handling this by
>
> Running the loader at 80% of C
> Disabling the destination in Opensips if 75% of the calls fail for the 
> particular destination (Attached loadbalancer.cfg file).
>
>
> But even in this case, it is possible that may call error out as the 
> destination is free and calls are loaded.
>
> We would like to avoid this scenario to the max possible extent by limiting 
> the number of calls we send to this particular destination.
>
> Couple of options I see are as below:
>
> Wait for a brief period before sending the response to loader when the error 
> happens
> Make OpenSips aware of the destination capacity and adjust ports accordingly
>
> Write a custom script to poll destination capacity and use MI functions to 
> adjust accordingly
> Or is there any possibility to integrate similar to FreeSwitch driven routing
>
> Are there any other possibilities of adjusting the OpenSips capacity 
> dynamically or make it limit the calls sent to the particular destination?
>
> --
>
> Regards,
> Chandan Ravishankar
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] OpenSips Load balancer. - Overcome limitations of Call Driven Load Balancing

2020-07-24 Thread Chandan PR
Hello Everyone,

Currently, we are using Open Sips Load balancer in Call Driven load
balancing .

Our scenario is as below:

*D* - Total Destinations configured at OpenSips
*P* - No of Ports/Sessions Each Destination can handle concurrently
*C* - Total Capacity = D*P

We have a Call Loader which loads calls to OpenSips at C and as when the
result comes further calls get loaded.
For some reason, if any destination is not in the right state and sends
error responses without accepting calls, this introduces a drain scenario.
In the drain scenario where all new calls are given to the faulty
destination as it has more availability.

We are currently handling this by

   1. Running the loader at 80% of C
   2. Disabling the destination in Opensips if 75% of the calls fail for
   the particular destination (Attached loadbalancer.cfg file).


But even in this case, it is possible that may call error out as the
destination is free and calls are loaded.

We would like to avoid this scenario to the max possible extent by limiting
the number of calls we send to this particular destination.

Couple of options I see are as below:

   1. Wait for a brief period before sending the response to loader when
   the error happens
   2. Make OpenSips aware of the destination capacity and adjust ports
   accordingly
  - Write a custom script to poll destination capacity and use MI
  functions to adjust accordingly
  - Or is there any possibility to integrate similar to FreeSwitch
  driven routing
  


Are there any other possibilities of adjusting the OpenSips capacity
dynamically or make it limit the calls sent to the particular destination?

-- 

Regards,
Chandan Ravishankar 


loadbalancer.cfg
Description: Binary data
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users