[OpenSIPS-Devel] [opensips] Feature Request: Weighted Round-Robin in Dispatcher (#508)

rrb3942 notifications at github.com
Tue May 12 22:40:33 CEST 2015


The dispatcher table has a weight column that is not currently used by the round-robin algorithm.

I think this would be useful to have as currently the only way to do, for example, a 2:1 ratio of traffic between gateways with dispatcher in round-robin is to enter one of the gateways into the table twice. While this works for a small number of gateways its does not scale well and becomes cumbersome to manage with a large number of gateways. I also think it offers a good, simple alternative to the hashing methods for weighted call distribution.

Proposed behavior:
When selecting a new destination set  (ds_select_*) the weight should multiply the number of times a gateway will be selected and chosen as the first destination. However each gateway, regardless of weight should only be tried once in event of a fail-over. So, ds_next_* should immediately skip to the next unique gateway, regardless of weight.

Example:
gw1 - weight of 2
gw2 - weight of 2
gw3 - weight of 1

For the first two calls to ds_select_* gw1 would be selected as the initial gateway, with the fail-over set for ds_next_* being gw2 and gw3 with each only appearing once. The next two calls to ds_select_* would select gw2, with a fail-over set of gw3 and gw1. The fifth call to ds_select_* would select gw3 with a fail-over of gw1 and gw2. Finally the sixth call to ds_select_* would wrap back around to gw1.


Thank you for your time.

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/508
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20150512/6efd1a85/attachment.htm>


More information about the Devel mailing list