Vincent_96516
Apr 17, 2012Nimbostratus
Message 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 backend nodes are down), how can I close the client connection?
The following are the script I use:
when SERVER_CLOSED {
log local0. "Server connection closed to [IP::server_addr]."
if { [active_members [LB::server pool]] == 0 } {
clientside {
TCP::close
log local0. "TCP connection closed to [TCP::local_port]."
}
}
}
but the client connection is not closed. Are there any mblb related configuration for this?
(2) In one of our virtual server, server side will initial request, client will sent response. To maintain the backend connections (connections between LTM and server nodes), I set up a timer to broadcast ping message to all backend nodes as following:
when SERVER_CLOSED {
log local0. "Server connection closed to [IP::server_addr]."
if { [active_members [LB::server pool]] == 0 } {
clientside {
TCP::close
log local0. "TCP connection closed to [TCP::local_port]."
}
} else {
if { [info exists status_timer] } {
$timer exists, do nothing
} else {
log local0. "Set status timer"
set status_timer [after 30000 -periodic {
clientside {
foreach m [active_members -list [LB::server pool]] {
pool [LB::server pool] member [lindex $m 0] [lindex $m 1]
log local0. "send status ping to $m"
TCP::payload replace 0 0 $static::conn_ping
TCP::release 2
TCP::notify request
}
}
}]
}
}
}
The timer is set, but the ping message was not sent. Is there anything wrong with the code? $static::conn_ping is a 2 bytes ping message.