Hi All,
I'm having a wee little bit of difficulty in trying to load-balance registrations to multiple servers based on their weights.
Kind of similar scenario as discussed in this thread: http://lists.sip-router.org/pipermail/sr-users/2014-December/086235.html
The problem I'm facing is that dispatcher is always choosing the first destination from the group.
I do suspect that dispatcher is not considering registrations as load at all and only counts INVITES as load.
If above is correct then is there a way to use dispatcher to count registrations as load ?
Thanks, Sammy
Your reference to “dispatcher is not considering registrations as load at all and only counts INVITES as load.” leads me to believe that you are trying to use algorithm 10 since that’s the only mechanism that cares about call loading.
Working from that assumption, the documentation clearly states “This algorithm can be used only for dispatching INVITE requests as it is the only SIP method creating a SIP call.”
http://kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatcher.f...
Brooks Bridges | Sr. Voice Services Engineer O1 Communications 5190 Golden Foothill Pkwy El Dorado Hills, CA 95762 office: 916.235.2097 | main: 888.444.1111, Option 2 email: bbridges@o1.commailto:bbridges@o1.com | web: www.o1.comhttp://www.o1.com/
From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of SamyGo Sent: Thursday, March 24, 2016 10:17 AM To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List Subject: [SR-Users] Dispatching Registrations to Weight based servers
Hi All,
I'm having a wee little bit of difficulty in trying to load-balance registrations to multiple servers based on their weights.
Kind of similar scenario as discussed in this thread: http://lists.sip-router.org/pipermail/sr-users/2014-December/086235.html
The problem I'm facing is that dispatcher is always choosing the first destination from the group.
I do suspect that dispatcher is not considering registrations as load at all and only counts INVITES as load.
If above is correct then is there a way to use dispatcher to count registrations as load ?
Thanks, Sammy
Hi Brooks,
Well no I'm using algo 9, with weights assigned to each IP in the set.
The reason why I suspect that is because the load set and unset load related functions are mentioned to work only with INVITE. With the weights defined its only logical to assume that dispatcher will count the stuff thrown to a particular destination. Question is if Kamailio counts Registrations as stuff(*load*) or not..
Now here is my dispatcher set
SET:: 1 URI:: sip:1.2.33.4:5060 flags=AP priority=1 attrs=weight=10,registrations=500 URI:: sip:2.3.4.9:5060 flags=AP priority=1 attrs=weight=10,registrations=500
Here is my code snippet where registrations are dispatched:
if ( !ds_select_dst("1","9") ) { send_reply("500","Service full"); exit; } xlog("L_NOTICE", "[$fU@$si:$sp]{$rm@$rU} DISPATCHER: Selected PBX IP:$du Capacity Attr:$avp(pbx_attr) Total PBXs: $avp(dst_group) are $avp(dst_count)-\n");
Thanks for taking out time to understand and reply.
Regards, Sammy
On Thu, Mar 24, 2016 at 1:31 PM, Brooks Bridges bbridges@o1.com wrote:
Your reference to “dispatcher is not considering registrations as load at all and only counts INVITES as load.” leads me to believe that you are trying to use algorithm 10 since that’s the only mechanism that cares about call loading.
Working from that assumption, the documentation clearly states “This algorithm can be used only for dispatching INVITE requests as it is the only SIP method creating a SIP call.”
http://kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatcher.f...
*Brooks Bridges | *Sr. Voice Services Engineer
*O1 Communications*
5190 Golden Foothill Pkwy
El Dorado Hills, CA 95762
*office:* 916.235.2097 | *main:* 888.444.1111, Option 2
*email:* bbridges@o1.com | *web:* www.o1.com
*From:* sr-users [mailto:sr-users-bounces@lists.sip-router.org] *On Behalf Of *SamyGo *Sent:* Thursday, March 24, 2016 10:17 AM *To:* SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List *Subject:* [SR-Users] Dispatching Registrations to Weight based servers
Hi All,
I'm having a wee little bit of difficulty in trying to load-balance registrations to multiple servers based on their weights.
Kind of similar scenario as discussed in this thread: http://lists.sip-router.org/pipermail/sr-users/2014-December/086235.html
The problem I'm facing is that dispatcher is always choosing the first destination from the group.
I do suspect that dispatcher is not considering registrations as load at all and only counts INVITES as load.
If above is correct then is there a way to use dispatcher to count registrations as load ?
Thanks,
Sammy
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
Hi All,
I think I got the answer from reading the dispatcher.c source code: https://github.com/kamailio/kamailio/blob/master/modules/dispatcher/dispatch... Line: 577
Says:
*/* if the array was not completely filled (i.e., the sum of weights is* less than 100), then use last address to fill the rest */* So clearly I was initializing two destinations with weight=20 and hence code was doing what it is supposed to do, send everything to the last address.
Now I've modified the two destinations weight = 50 and now REGISTRATIONS get load-balanced as I desired.
Thing to remember for future reference, For algo 9 always sum up weights for destinations to equal 100.
Thanks again for reading, and replying Brooks.
Regards, Sammy
On Thu, Mar 24, 2016 at 2:08 PM, SamyGo govoiper@gmail.com wrote:
Hi Brooks,
Well no I'm using algo 9, with weights assigned to each IP in the set.
The reason why I suspect that is because the load set and unset load related functions are mentioned to work only with INVITE. With the weights defined its only logical to assume that dispatcher will count the stuff thrown to a particular destination. Question is if Kamailio counts Registrations as stuff(*load*) or not..
Now here is my dispatcher set
SET:: 1 URI:: sip:1.2.33.4:5060 flags=AP priority=1 attrs=weight=10,registrations=500 URI:: sip:2.3.4.9:5060 flags=AP priority=1 attrs=weight=10,registrations=500
Here is my code snippet where registrations are dispatched:
if ( !ds_select_dst("1","9") ) { send_reply("500","Service full"); exit; } xlog("L_NOTICE", "[$fU@$si:$sp]{$rm@$rU} DISPATCHER: Selected PBX IP:$du Capacity Attr:$avp(pbx_attr) Total PBXs: $avp(dst_group) are $avp(dst_count)-\n");
Thanks for taking out time to understand and reply.
Regards, Sammy
On Thu, Mar 24, 2016 at 1:31 PM, Brooks Bridges bbridges@o1.com wrote:
Your reference to “dispatcher is not considering registrations as load at all and only counts INVITES as load.” leads me to believe that you are trying to use algorithm 10 since that’s the only mechanism that cares about call loading.
Working from that assumption, the documentation clearly states “This algorithm can be used only for dispatching INVITE requests as it is the only SIP method creating a SIP call.”
http://kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatcher.f...
*Brooks Bridges | *Sr. Voice Services Engineer
*O1 Communications*
5190 Golden Foothill Pkwy
El Dorado Hills, CA 95762
*office:* 916.235.2097 | *main:* 888.444.1111, Option 2
*email:* bbridges@o1.com | *web:* www.o1.com
*From:* sr-users [mailto:sr-users-bounces@lists.sip-router.org] *On Behalf Of *SamyGo *Sent:* Thursday, March 24, 2016 10:17 AM *To:* SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List *Subject:* [SR-Users] Dispatching Registrations to Weight based servers
Hi All,
I'm having a wee little bit of difficulty in trying to load-balance registrations to multiple servers based on their weights.
Kind of similar scenario as discussed in this thread: http://lists.sip-router.org/pipermail/sr-users/2014-December/086235.html
The problem I'm facing is that dispatcher is always choosing the first destination from the group.
I do suspect that dispatcher is not considering registrations as load at all and only counts INVITES as load.
If above is correct then is there a way to use dispatcher to count registrations as load ?
Thanks,
Sammy
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