drouting: varios entries in 'dr_rules' with some "groupid', not possible?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

drouting: varios entries in 'dr_rules' with some "groupid', not possible?

Iñaki Baz Castillo
Hi, I'm trying to figure if it makes sense and it's possible to set various
entries in 'dr_rules' table with same 'groupid' but different 'priority' so
after trying all the gateways in the rule with highest priority, the gateways
in the second rule would be tryed.

However it seems that I'm wrong since it doesn't work. Just the rule with
highest priority is taken (and all its configured gateways or list of
gateways).

In the doc I read:

--------------------------------------
1.1.5. Routing Rule Processing

within the set of rules is applied the time criteria, and the rule which has
the highest priority and matches the time criteria is selected to drive the
routing.
--------------------------------------

But it doesn't work for me. I've two rules:

rule 1:
- groupid = 1
- priority = 10 (highest)
- gwlist = 1,2

rule 2:
- groupid = 1
- priority = 5
- gwlist = 3,4


Then in the script I do:

  do_routing("1");
  t_relay();

and in failure route:
  if t_check_status("408|503") {
    use_next_gw();
    t_relay();
  }


In my example call the rule 1 is choosen (since it has highest prioriry).
Gateways 1 and 2 fail (reply 503 code) and there is no more failover, this is:
servers 3 and 4 are not tryed, is it the expected behaviour?


Thanks.


--
Iñaki Baz Castillo <[hidden email]>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: drouting: varios entries in 'dr_rules' with some "groupid', not possible?

Iñaki Baz Castillo
2009/9/14 Iñaki Baz Castillo <[hidden email]>:
> In my example call the rule 1 is choosen (since it has highest prioriry).
> Gateways 1 and 2 fail (reply 503 code) and there is no more failover, this is:
> servers 3 and 4 are not tryed, is it the expected behaviour?

After more testing I cannot get it working (just the rule with highest
priority is retrieved) so why does "priority" field exist?

Also, I fail to understand how could I configure a balancing system
with different weight, something as:

  gw1 => 60%
  gw2 => 40%

The only I can get is a 50% distribution by setting gw1 and gw2 in a
dr_rule (and selecting "order" != 0).


--
Iñaki Baz Castillo
<[hidden email]>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: drouting: varios entries in 'dr_rules' with some "groupid', not possible?

Iñaki Baz Castillo
2009/9/14 Iñaki Baz Castillo <[hidden email]>:

> 2009/9/14 Iñaki Baz Castillo <[hidden email]>:
>> In my example call the rule 1 is choosen (since it has highest prioriry).
>> Gateways 1 and 2 fail (reply 503 code) and there is no more failover, this is:
>> servers 3 and 4 are not tryed, is it the expected behaviour?
>
> After more testing I cannot get it working (just the rule with highest
> priority is retrieved) so why does "priority" field exist?
>
> Also, I fail to understand how could I configure a balancing system
> with different weight, something as:
>
>  gw1 => 60%
>  gw2 => 40%
>
> The only I can get is a 50% distribution by setting gw1 and gw2 in a
> dr_rule (and selecting "order" != 0).

Drouting modules is, theorically, more powerful than LCR module, but
the fact is I can't do a simple weight balancing (60% - 40%) as I
explained above.
Do I miss something?

Any help please?



--
Iñaki Baz Castillo
<[hidden email]>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: drouting: varios entries in 'dr_rules' with some "groupid', not possible?

Bogdan-Andrei Iancu
In reply to this post by Iñaki Baz Castillo
Hi Iñaki,

priority applies only to rules that overlap - this can happens only when
time selection is used for the rules:

Ex: RULE1:  for prefix 1234, all the time,  use GW1, prio =1
      RULE2:  for prefix 1234, during weekend, use GW1, prio = 4

Here the rules will overlap during the weekend - they both match; in
this interval, the highest priority rule will be used.

The priority mechanism is used exclusively for this case.

The module does not do any rule fallback - once a rule is match, it will
use only the destination from the rules and it will not try to re-match
a different rule.

Regards,
Bogdan

Iñaki Baz Castillo wrote:

> Hi, I'm trying to figure if it makes sense and it's possible to set various
> entries in 'dr_rules' table with same 'groupid' but different 'priority' so
> after trying all the gateways in the rule with highest priority, the gateways
> in the second rule would be tryed.
>
> However it seems that I'm wrong since it doesn't work. Just the rule with
> highest priority is taken (and all its configured gateways or list of
> gateways).
>
> In the doc I read:
>
> --------------------------------------
> 1.1.5. Routing Rule Processing
>
> within the set of rules is applied the time criteria, and the rule which has
> the highest priority and matches the time criteria is selected to drive the
> routing.
> --------------------------------------
>
> But it doesn't work for me. I've two rules:
>
> rule 1:
> - groupid = 1
> - priority = 10 (highest)
> - gwlist = 1,2
>
> rule 2:
> - groupid = 1
> - priority = 5
> - gwlist = 3,4
>
>
> Then in the script I do:
>
>   do_routing("1");
>   t_relay();
>
> and in failure route:
>   if t_check_status("408|503") {
>     use_next_gw();
>     t_relay();
>   }
>
>
> In my example call the rule 1 is choosen (since it has highest prioriry).
> Gateways 1 and 2 fail (reply 503 code) and there is no more failover, this is:
> servers 3 and 4 are not tryed, is it the expected behaviour?
>
>
> Thanks.
>
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: drouting: varios entries in 'dr_rules' with some "groupid', not possible?

Bogdan-Andrei Iancu
In reply to this post by Iñaki Baz Castillo
Hi Iñaki,

Iñaki Baz Castillo wrote:

> 2009/9/14 Iñaki Baz Castillo <[hidden email]>:
>  
>> In my example call the rule 1 is choosen (since it has highest prioriry).
>> Gateways 1 and 2 fail (reply 503 code) and there is no more failover, this is:
>> servers 3 and 4 are not tryed, is it the expected behaviour?
>>    
>
> After more testing I cannot get it working (just the rule with highest
> priority is retrieved) so why does "priority" field exist?
>
> Also, I fail to understand how could I configure a balancing system
> with different weight, something as:
>
>   gw1 => 60%
>   gw2 => 40%
>
> The only I can get is a 50% distribution by setting gw1 and gw2 in a
> dr_rule (and selecting "order" != 0).
>  
The module does not support native weight, but you can simulate it (with
order 1) :
 RULE1  -> GW: gw1,gw1,gw2,gw2,gw2

this will give you a 40% 60% distribution for the first selected GW from
the set.

Regards,
Bogdan

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: drouting: varios entries in 'dr_rules' with some "groupid', not possible?

Bogdan-Andrei Iancu
In reply to this post by Iñaki Baz Castillo
Iñaki Baz Castillo wrote:

> 2009/9/14 Iñaki Baz Castillo <[hidden email]>:
>  
>> 2009/9/14 Iñaki Baz Castillo <[hidden email]>:
>>    
>>> In my example call the rule 1 is choosen (since it has highest prioriry).
>>> Gateways 1 and 2 fail (reply 503 code) and there is no more failover, this is:
>>> servers 3 and 4 are not tryed, is it the expected behaviour?
>>>      
>> After more testing I cannot get it working (just the rule with highest
>> priority is retrieved) so why does "priority" field exist?
>>
>> Also, I fail to understand how could I configure a balancing system
>> with different weight, something as:
>>
>>  gw1 => 60%
>>  gw2 => 40%
>>
>> The only I can get is a 50% distribution by setting gw1 and gw2 in a
>> dr_rule (and selecting "order" != 0).
>>    
>
> Drouting modules is, theorically, more powerful than LCR module, but
> the fact is I can't do a simple weight balancing (60% - 40%) as I
> explained above.
> Do I miss something?
>
> Any help please?
>  
Sorry for delay - I was caught with Andrei, for the last 3 hours in a
debugging and fixing of TM module - some race condition in
retransmission algorithm.

Please see my previous email.

Regards,
Bogdan


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: drouting: varios entries in 'dr_rules' with some "groupid', not possible?

Iñaki Baz Castillo
In reply to this post by Bogdan-Andrei Iancu
2009/9/15 Bogdan-Andrei Iancu <[hidden email]>:

> Hi Iñaki,
>
> priority applies only to rules that overlap - this can happens only when
> time selection is used for the rules:
>
> Ex: RULE1:  for prefix 1234, all the time,  use GW1, prio =1
>      RULE2:  for prefix 1234, during weekend, use GW1, prio = 4
>
> Here the rules will overlap during the weekend - they both match; in
> this interval, the highest priority rule will be used.
>
> The priority mechanism is used exclusively for this case.

So in case time selection is null in botrules, priority mechanism
doesn't matter, right?
If so, I suggest to explain it in the documentation, as I couldn't
understand it after several reads :)


> The module does not do any rule fallback - once a rule is match, it will
> use only the destination from the rules and it will not try to re-match
> a different rule.

Yes, but if all the gws in a rule (prio 10) fail (so "use_next_gw"
returns false) then this rule (or its gws) would be automatically
included in a blacklist, so if then I call again
"do_routing(SAME_GROUPID)" then the next rule (minor priority) would
be taken, am I right?


Thanks a lot.


--
Iñaki Baz Castillo
<[hidden email]>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: drouting: varios entries in 'dr_rules' with some "groupid', not possible?

Iñaki Baz Castillo
In reply to this post by Bogdan-Andrei Iancu
2009/9/15 Bogdan-Andrei Iancu <[hidden email]>:
> The module does not support native weight, but you can simulate it (with
> order 1) :
>  RULE1  -> GW: gw1,gw1,gw2,gw2,gw2
>
> this will give you a 40% 60% distribution for the first selected GW from
> the set.

ok, it's enough for my needs :)


--
Iñaki Baz Castillo
<[hidden email]>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: drouting: varios entries in 'dr_rules' with some "groupid', not possible?

Bogdan-Andrei Iancu
In reply to this post by Iñaki Baz Castillo
Iñaki Baz Castillo wrote:

> 2009/9/15 Bogdan-Andrei Iancu <[hidden email]>:
>  
>> Hi Iñaki,
>>
>> priority applies only to rules that overlap - this can happens only when
>> time selection is used for the rules:
>>
>> Ex: RULE1:  for prefix 1234, all the time,  use GW1, prio =1
>>      RULE2:  for prefix 1234, during weekend, use GW1, prio = 4
>>
>> Here the rules will overlap during the weekend - they both match; in
>> this interval, the highest priority rule will be used.
>>
>> The priority mechanism is used exclusively for this case.
>>    
>
> So in case time selection is null in botrules, priority mechanism
> doesn't matter, right?
> If so, I suggest to explain it in the documentation, as I couldn't
> understand it after several reads :)
>  

Let me tell you a joke:
  Q: "What do engineers and dogs have in common ? "
  A: "They both have an intelligent eyes/look, but none of them can
express themselves"

So, I will try to re-work the explanation there.

>
>  
>> The module does not do any rule fallback - once a rule is match, it will
>> use only the destination from the rules and it will not try to re-match
>> a different rule.
>>    
>
> Yes, but if all the gws in a rule (prio 10) fail (so "use_next_gw"
> returns false) then this rule (or its gws) would be automatically
> included in a blacklist, so if then I call again
> "do_routing(SAME_GROUPID)" then the next rule (minor priority) would
> be taken, am I right?
>  
yes, make sense - probably we can add it for 1.7 ....for 1.6 is a bit
too late.


Best regards,
Bogdan



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: drouting: varios entries in 'dr_rules' with some "groupid', not possible?

Iñaki Baz Castillo
2009/9/15 Bogdan-Andrei Iancu <[hidden email]>:

>> So in case time selection is null in botrules, priority mechanism
>> doesn't matter, right?
>> If so, I suggest to explain it in the documentation, as I couldn't
>> understand it after several reads :)
>>
>
> Let me tell you a joke:
>  Q: "What do engineers and dogs have in common ? "
>  A: "They both have an intelligent eyes/look, but none of them can
> express themselves"

XD



>> Yes, but if all the gws in a rule (prio 10) fail (so "use_next_gw"
>> returns false) then this rule (or its gws) would be automatically
>> included in a blacklist, so if then I call again
>> "do_routing(SAME_GROUPID)" then the next rule (minor priority) would
>> be taken, am I right?
>>
> yes, make sense - probably we can add it for 1.7 ....for 1.6 is a bit
> too late.

Ops, I expected that was the current and already implemented behaviour !

Ok, thanks.


--
Iñaki Baz Castillo
<[hidden email]>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users