Forum Discussion
Message-based load balancing problem
Got some inspiration from this https://devcentral.f5.com/Forums/tabid/53/afv/topic/aff/5/aft/2161558/Default.aspx So I tested by removing some TCP::collect from the irules. The delayed response problem disappeared after I commented the TCP::collect in rules handling SERVER_CONNECTED event. However I realized it was not message-based load balancing but connection based load balancing. I did add "mblb" profile to the virtual server. Obviously the irules I wrote to extract individual messages didn't work. But why?
Can someone explain to me when I should use TCP::collect? I found some examples call TCP::collect almost in every event declaration, which I don't understand. I personally think I only need to call it in CLIENT_ACCEPTED and CLIENT_DATA.
Below are my current irules:
when CLIENT_ACCEPTED {
set client_closed 0
TCP::collect
}
periodically checks if the client connection closed, if so, also closes associated server connection.
when CLIENT_CLOSED {
set client_closed 1
}
Triggered when a connection has been established with the target node
when SERVER_CONNECTED {
after 1000 -periodic if {$client_closed} {TCP::close}
TCP::collect
}
when CLIENT_DATA {
binary scan [TCP::payload] II head rlen
if {($head & 0x3) == 1} {
if {[TCP::payload length] < [expr {8 + $rlen}]} {
TCP::collect [expr {$rlen + 8 - [TCP::payload length]}]
return
}
}
TCP::release [expr {$rlen + 8}]
TCP::notify request
TCP::collect
}
when USER_REQUEST {
pool my_pool
}
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