[OpenSIPS-Users] Load balancer - releasing resources

2009-12-23 Thread Peter P GMX
Hello,

we use OpenSIPS as a load balancer in front of a Freeswitch cluster. We
use the load_balancer module for load_balancing and redirecting requests
to this 2 machines.
For each machine we have defined a number of resources (e.g. 3000 for
each server). After a while these resources are full, so the load
balancer module does not balance any more.
Here some extract from the routing:
if ($si=~"^xxx.xx.xxx.xxx") {
# redirect external gateways to the right server
load_balance("1","external");
$ru = "sip:" + $rU + "@" + $dd + ":" + $dp;
sl_send_reply("302", "redirect");
exit;
} else {
} else {
# load balance all registered phones through OpenSIPS
load_balance("1","internal");

 }

if (!t_relay()) {
sl_reply_error();
}

My main question is: Does OpenSIPS automatically release the load
balancer resources after a while? Or does it release when a SIP session
is ended?
We have now set the resources to 3 but we do not know for how
long they may last.

Best regards
Peter

 

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


Re: [OpenSIPS-Users] Load balancer - releasing resources

2009-12-24 Thread Bogdan-Andrei Iancu
Hello Peter,

LB does not work for the redirect scenario, but only for a call through 
(proxy) scenario. Because OpenSIPS considers as load the number of 
ongoing calls, and into a redirect scenario, opensips cannot know how 
many ongoing call are.

Also, use all the time the stateful functions when using LB. LB 
mechanism is tied to dialogs which are tied to transactions. So replace 
the sl_send_reply() with t_reply() .

Regards,
Bogdan

Peter P GMX wrote:
> Hello,
>
> we use OpenSIPS as a load balancer in front of a Freeswitch cluster. We
> use the load_balancer module for load_balancing and redirecting requests
> to this 2 machines.
> For each machine we have defined a number of resources (e.g. 3000 for
> each server). After a while these resources are full, so the load
> balancer module does not balance any more.
> Here some extract from the routing:
> if ($si=~"^xxx.xx.xxx.xxx") {
> # redirect external gateways to the right server
> load_balance("1","external");
> $ru = "sip:" + $rU + "@" + $dd + ":" + $dp;
> sl_send_reply("302", "redirect");
> exit;
> } else {
> } else {
> # load balance all registered phones through OpenSIPS
> load_balance("1","internal");
> 
>  }
>
> if (!t_relay()) {
> sl_reply_error();
> }
>
> My main question is: Does OpenSIPS automatically release the load
> balancer resources after a while? Or does it release when a SIP session
> is ended?
> We have now set the resources to 3 but we do not know for how
> long they may last.
>
> Best regards
> Peter
>
>  
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro


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