[SR-Users] LCR weight

Camila Troncoso ctroncoso at redvoiss.net
Tue Nov 20 14:36:03 CET 2012


Hi,

Here is a copy of part of README:


"
When the function load_gws() is called, matching gateways (that are not
   currently designated as defunct) are ordered for forwarding purposes as
   follows:

     * (1) according to longest user part match
     * (2) according to tuple's priority
     * (3) according to tuple's randomized weight

....

Weight is an integer value from 1 to 254. Weight implementation is
   fast, but unfair favoring larger weight values at the expense smaller
   ones. For example, if two gateways have weights 1 and 2, probability
   that the gateway with weight 1 is tried first is 1/4, not 1/3. Two
   scripts are provided in lcr/utils directory that can be used to check
   the probabilities resulting from a given set of weight values. Same can
   be done with command 'kamctl eval_weights'.

"

I really don't understand what is the probability finally assign to each
gateway when they have the same priority.
All I can see is that it doesn't correspond to percentage of capacity from
the example above , but how can I determine what value gives the percent
that I want?

Please give an example like:

Rule_id	Gw_id	 Priority	weight
36		68		1	60
36		69		1	14
36		70		1	13
36		71		1	13

Regards,

Camila


-----Original Message-----
From: sr-users-bounces at lists.sip-router.org
[mailto:sr-users-bounces at lists.sip-router.org] On Behalf Of Juha Heinanen
Sent: lunes, 19 de noviembre de 2012 20:37
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users
Mailing List
Subject: [SR-Users] LCR weight

Camila Troncoso writes:

> The weight variable acts as a percentage of utility of that gateway?
>
> If for example I have 100 calls, the gateway with gw_id 68 will
> receive 60 calls , and the other 14, 13 and 13?

check README.  it used to explain how weight is interpreted.

-- juha

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users at lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



More information about the sr-users mailing list