Why not just increase the max tcp connections? Also, once you hit it, Kamailio will reset the syn and the load balancer should try on a different server.

I am look for something like what you’re looking for but reset the sub on-demand so I can put the server in maintenance mode.

Regards,

David Villasmil
email: david.villasmil.work@gmail.com
phone: +34669448337


On Tue, 6 Feb 2024 at 12:47, Sebastian Damm via sr-users <sr-users@lists.kamailio.org> wrote:
Hello,

My plan is to reject new inbound requests if there is already a certain number of open connections on one Kamailio server. I could answer with a 503 and directly close the connection forcing the client to reconnect and the loadbalancer to send traffic to a different node on the next connect. It's just a last-resort measure to prevent Kamailio from running into the configured TCP connection limit (workarounding a poorly-implemented external load balancer).

Since I didn't find anything in the docs: Is there a pseudovariable containing the current number of open tcp/tls connections on this Kamailio? I can (and already do) query them via kamcmd or rpc, but can I access the variable from inside the routing script as well?

Regards,
Sebastian
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe: