we recently replaced Cisco CSS by F5 BigIP, but we know have a problem in our production environment under load which we did not noticed in out acceptance environment.
We have a virtual configured and on this virtual we have an irules which does pool selection based on the requested uri.
What I see in the tcpdumps I took, is that on an existing tcp session there are several GET and POST requests where I can see the identical GET or POST message is also send to a poolmember as you would expect. But sometimes on an open client tcp connection we are getting a http GET or POST request and I do not see the request being send to a poolmember. I do see the F5 is first responding with a ACK and than ~5 seconds later a [RST, ACK] is send back to the client terminating the TCP session.
The uri requested should match on of uri’s in the irules and I don’t have any poolmembers down messages in the ltm log. Some of the pools are used in combination with SNAT automap, the uri with problems are mostly for pools without snat.
I have seen a couple of post reporting the same behaviour, but haven’t seen a solution. Does anybody know what can cause this behaviour and how it can be solved?
That poster resolve their issue by adding more IPs to a SNAT pool. Do you see any errors like inet port exhaustion in the /var/log/ltm file when the failures occur?
we are only using snat automap on a couple of pools, the http requests that are replied with the [RST, ACK] are for the pools without snat configured. I have also no messages at all in the /var/log/ltm.
We are using a ONECONNECT profile on this virtual otherwise the uri loadbalancing is not working correclty.
I will post our config tomorrow ( don’t have access to the box at the moment)
I am also looking into the possibility the reset was send because it did not match any of the uri’s in the switch statement. I have checked the tcpdump and on a first glance I only see requests that should match, but I will have closer look.
Since the problem happened in the production environment the business decided to rollback to the CSS. We are now going to try to replicate the problem on our acceptance environment by increasing the test load. When this is ready I will add log statements in the default action to see if there are hits here.
Finally managed to replicate our problem in the acceptance environment.
What I have found that it looks like that once ‘snat automap’ is used for one of the pools in the irule all future request(in this tcp session) will also have snat enabled even for pools were this not configured.
Since there is a FW in between the F5 and the poolmembers, the tcp session where SNAT is incorrectly used are dropped by the FW, since it is only configured to allow traffic from specific clients and only the self-ips of the F5 (health monitors). After F5 unanswerred SYNC on the serverside the F5 is sending the [RST, ACK] on the client side.
My firs idea was to explicitly disable snat for all other pools by adding ‘snat none’ but this did not make a difference.
Does anybody have an idea how to limit SNAT to only be used in the pools were is it required?
I think you’d need to do an LB::reselect pool if the request wasn’t the first one in the tcp connection… I’m not certain that it’s defined what happens otherwise (In fact I’m surprised it doesn’t just fail).
Oh.. And a ‘snat none’ to turn off any SNAT’ing that was performed previously.
I think the most intuitive way to handle this is to call snat none or snat automap for each switch case in the iRule. You’d want to leave SNAT set to the default of allow on each pool. This way all of the SNAT related config is handled in one place in the iRule.
Personally, I’d follow the old (Python) idiom of “explicit is better than implicit” and setup a dedicated snat pool for each of your destination pools, even with a single member in the snat pool. Then switch to the appropriate snat pool specifically. It’s way more predictable, tunable, and less ambiguous than relying on automap. E.g. app1, app2, app3 would have a snat pool each.