Forum Discussion
Vincent_96516
Nimbostratus
Apr 17, 2012Message based load balancing connection status
I am creating irules script to work under message based load balancing profile (mblb), the following are some issues I have (OS v.10.2.3):
(1) When there are no active members in the pool (all ba...
Nat_Thirasuttakorn
Employee
Apr 17, 2012Hi Vincent,
(1) When there are no active members in the pool (all backend nodes are down), how can I close the client connection?
you may try this way...
note that return value of active_members may not be the same as number of current active connection for the particular client connection.
you could keep track that by using variable. here are 2 examples
example I
when CLIENT_ACCEPTED {
check every second
after 1000 -periodic {
if { [active_members [LB::server pool]] == 0 } {
reject
log local0. "TCP connection closed to [TCP::local_port]."
}
}
}
example II
when CLIENT_ACCEPTED {
array set server_array {}
check every second
after 2000 -periodic {
if { [array size server_array] == 0 } {
reject
log local0. "TCP connection closed to [TCP::local_port]."
}
}
}
when SERVER_CONNECTED {
set s "[IP::remote_addr] [TCP::remote_port]"
set server_array($s) 1
}
when SERVER_CLOSED {
set s "[IP::remote_addr] [TCP::remote_port]"
unset server_array($s)
}
(2) to periodically send somethig to server every 30 seconds, you can do as follow
when SERVER_CONNECTED {
send ping every 30 seconds
after 30000 -periodic {
you could add some code to check idletime here...
TCP::respond $static::conn_ping
}
}
May I ask what is your use case that you are using mblb profile for?
This information would help us improve future version of mblb profile 🙂
Thanks,
Nat
v
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects