Forum Discussion
Using Powershell to create an iApp Service
For future reference...
Was the solution to enable rewrite redirects on an HTTP profile? Or maybe change the app config so it knows it's being SSL proxied?
Thanks, Aaron
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 {
}
periodically checks if the client connection closed, if so, also closes associated server connection.
when CLIENT_CLOSED {
}
Triggered when a connection has been established with the target node
when SERVER_CONNECTED {
}
when CLIENT_DATA {
binary scan [TCP::payload] II head rlen
if {($head & 0x3) == 1} {
}
TCP::release [expr {$rlen + 8}]
TCP::notify request
TCP::collect
}
when USER_REQUEST {
}
- Michael_YatesJul 30, 2012
Nimbostratus
Hi Shu, - Nat_ThirasuttakornJul 31, 2012
Employee
Hi Shu, - Thanks, Nat! You made my day. Moving pool command to CLIENT_DATA is the right solution. Unfortunately, I couldn't find this on the documents I've read so far and F5 support didn't even want to look at the simple irules I wrote.
- Fabian_Arroyo_MSep 09, 2015
Nimbostratus
Hi Shu, the correct iRule would it?
when CLIENT_ACCEPTED {
set client_closed 0 TCP::collect
}
when CLIENT_CLOSED {
set client_closed 1
}
when SERVER_CONNECTED { after 1000 -periodic if {$client_closed} {TCP::close} }
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 }
}
pool my_pool
TCP::release [expr {$rlen + 8}]
TCP::notify request
TCP::collect
}