Forum Discussion
Rebalancing connections
- Jan 18, 2023
Thanks guys!
Basically there is no option to transfer already established connections to the new pool member.
There's a way in case it's HTTP traffic and pool nodes are in different priority groups - to force connections to reconnect to higher priority node once it comes back online.
We use this simple irule which checks on every HTTP response whether it's delivered from highest available priority group - if not we call HTTP::close which gracefully closes the connection after response is delivered, forcing client to establish a new connection. As this is graceful (not a TCP reset or similar), it's not impacting.
when HTTP_RESPONSE {
if {[HTTP::is_keepalive]} {
set serverip_active 0
foreach { pmem } [active_members -list [LB::server pool]] {
if { [IP::addr [IP::server_addr] equals [getfield $pmem " " 1]] } {
set serverip_active 1
break
}
}
if { $serverip_active equals 0 } {
HTTP::close
}
}
}To rebalance connections within the same priority group, one would need to check number of connections to all nodes and compare them with configured ratio. As far as I can tell there's no easy way to achieve that, number of connections would need to be tracked externally (in session table or istats).
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com