Hello there,
I'm doing stress testing against kamailio (sip load balancer role) sending sip registrar, my stress test software is sending 50 registrations per second, after 30 seconds and 1000 registers processed the function ds_select_dst (I'm using algorithm 4) returns null for all registers sent from my software, and all registrar sip servers are available and in active mode, if I reduce the software to send 20 registrar's per second, the issue only happens after 60 seconds and kamailio (sip load balancer role) process 4000 registrers, after this, function ds_select_dst starts returning null
Anyone has any idea why it is happening? My kamailio version is 4.2
Best Regards
Hello,
what do you mean starts returning null?
Does it enter inside a condition like:
if(!ds_select_dst(...))
Are there any error messages in syslog?
Daniel
On 16/12/14 12:51, José Seabra wrote:
Hello Daniel,
Yes it enter inside a condition.
my code is:
if(!ds_select_dst("9", "0")) { xlog("L_ERR", "Failed to select proxy - R=$ru ID=$ci\n"); sl_send_reply("503", "No proxy available, try again later"); exit; } and all sip registrers sent receives a sip reply 503 "No proxy available, try again later"
BR José Seabra
2014-12-16 12:06 GMT+00:00 Daniel-Constantin Mierla miconda@gmail.com:
Update: My last email has the wrong example, the correct code is:
if(!ds_select_dst("9", "4")) { xlog("L_ERR", "Failed to select proxy - R=$ru ID=$ci\n"); sl_send_reply("503", "No proxy available, try again later"); exit; }
I'm using algorithm 4.
2014-12-16 12:14 GMT+00:00 José Seabra joseseabra4@gmail.com:
Hello Daniel, Do you need more information from my kamailio settup, in order to try understand why this issue happens? Thank you BR José Seabra
2014-12-16 12:16 GMT+00:00 José Seabra joseseabra4@gmail.com:
Hello,
I asked in the first email - do you get error messages in syslog? If not, then you have to run with debug=3 and look at the log messages to see if you get further hints.
Cheers, Daniel
On 18/12/14 12:29, José Seabra wrote:
Hello Daniel, Thank you for your reply,
Please check out the attachment with kamailio logs in mode debug 3, i didn't find any errors, the only thingh that is confusing me is this line: /usr/local/sbin/kamailio[13690]: DEBUG: dispatcher [dispatch.c:1745]: ds_select_dst_limit(): alg hash [0]
I don't know if this "ds_select_dst_limit(): alg hash [0]" is related with algorithm parameter in function ds_select_dst, but, if yes i cannot understand why it is 0 because I'm using algorithm 4.
BR José Seabra
2014-12-18 11:35 GMT+00:00 Daniel-Constantin Mierla miconda@gmail.com:
Hi,
quick questions: - Do you have the Dispatcher Activity detection turned on? - Do you do something like "ds_mark_dst()" in your failure route? - Can you send me your config, so i can verify a few things?
Thanks, Carsten
2014-12-18 15:14 GMT+01:00 José Seabra joseseabra4@gmail.com:
Hi Carsten
My dispatcher configuration is:
# ----- dispatcher params ----- modparam("dispatcher", "table_name", "dispatcher") modparam("dispatcher", "force_dst", 2) modparam("dispatcher", "flags", 3) modparam("dispatcher", "db_url", DBURL) modparam("dispatcher", "dst_avp", "$avp(s:dst)") modparam("dispatcher", "cnt_avp", "$avp(s:dsp_uri_count)") modparam("dispatcher", "grp_avp", "$avp(s:dsp_uri_grp)") modparam("dispatcher", "ds_ping_method", "OPTIONS") modparam("dispatcher", "ds_ping_from", "sip:sipcheck@10.0.20.102:5062") modparam("dispatcher", "ds_ping_interval", 10) modparam("dispatcher", "ds_probing_threshhold", 3) modparam("dispatcher", "ds_probing_mode", 2)
Do you do something like "ds_mark_dst()" in your failure route?
Yes, I'm using ds_mark_dst inside of failure route, but the "REGISTER" is not entering in failure route in any case, because when "REGISTER" gets the function ds_select_dst, this function returns false and my kamailio sends a statless reply to phone and drops the message.
I did a test that was comment "ds_mark_dst("ip");" in failure route and even with this I still having the same issue.
route[HANDLE_REGISTER] { .... t_set_fr(0,2000); t_on_failure("PRXFAILURE");
if(!ds_select_dst("9", "4")) { xlog("L_ERR", "Failed to select proxy - R=$ru ID=$ci\n"); sl_send_reply("503", "No proxy available, try again later"); exit; }
...
route(RELAY);
}
failure_route[PRXFAILURE] { if(is_method("REGISTER") && (t_check_status("500") || t_branch_timeout() || !t_branch_replied())) { $var(cache_user) = $tU + "@" + $td; $sht(prxcache=>$var(cache_user))=$null; ds_mark_dst("ip"); if(ds_next_dst()) { #again set local timeout for reply t_set_fr(0,2000); t_on_failure("PRXFAILURE"); xlog("L_INFO", "PRX FAILURE -REGISTER New dest $du ID=$ci\n"); $sht(tmpcache=>$var(cache_user))=$du; route(RELAY); exit; } else { #last available node failed to reply, no other destinations available send_reply("404", "No destination"); exit;
}
} }
BR José Seabra
2014-12-18 14:43 GMT+00:00 Carsten Bock carsten@ng-voice.com:
Hello,
can you check the state of the gateways when you get this issue? Via: kamctl mi ds_list
If the REGISTERs are not replied, then you mark them as inactive.
Hash 0 means the the first entry in the group is used, as computed using the algorithm.
Cheers, Daniel
On 18/12/14 16:10, José Seabra wrote: