Fabian Borot writes: > 3 gws inside same group, and assuming the higher the weight the higher > the capacity > > gw 1 with weight 20 > gw 2 with weight 30 > gw 3 with weight 60 > > I would like to send more calls to gw 3, then gw 2 then gw 1 > but if when I do a load_gws, and I randomize the weight (meaning I get > a random value out of the possible 20, 30 and 60, then pick the gw > with that random value, for example rand() returns 20, then I really > obtain gw 2) then there is no guarantee that the order would be like I > want it.
> At least that is how I understand the "randomize" factor on this > logic, do I get it wrong? If so please advise. if you have three gws with weights 1, 2, and 3 and you make many calls, then first gw will receive less of them as the second, and second less of them than the third. how much less, see this text in readme: 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'. -- juha _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users