Forum Discussion

Michael_Yates_1's avatar
Michael_Yates_1
Icon for Nimbostratus rankNimbostratus
Oct 11, 2006

HTTP persistence for multiple clients on a single TCP Connection

Hi,

 

I need some help to fix some behaviour we are seeing in our BIG IP load balancer. Hopefully someone out there has seen the problem described below.

 

 

The situation:

 

- TCP connection opened from outside world to BIGIP

 

- First HTTP request down the connection contains persistence cookie BIGIP=server1

 

- Second HTTP request on same TCP connection contains persistence cookie BIGIP=server2

 

 

The result:

 

- First request goes to server1

 

- Second request goes to server1

 

- BUT second request SHOULD NOT have gone to server1 - its session was on server2

 

- First user gets a valid response

 

- Second user gets a failure response

 

 

So in summary. When using just the in built persitance methods (we are using passive persistence) the BIG IP only makes its persistence descision on the initial request. All subsequent requests made on the same TCP connection flow to the same back end server.

 

 

Other background:

 

All traffic arrriving at our service is aggregated by a gateway. This gateway relays all requests from the real HTTP clients to us. So to the outsde of the BIGIP our traffic all comes from a single IP address. This single IP address uses TCP connection pooling in order to minimise its server load. We have no access to change what is happening on the gateway aggregator.

 

 

 

I spoke with F5 about this and they suggested I write an iRule to achieve the persistence we need. They also suggested that this forum would be the best place to start to get some hints on writing such a rule. I haven't written iRules before but it seems conceptually easy.

 

 

Pseudocode:

 

 

OnHttpRequest()

 

{

 

If (request arrives without any persistence cookies)

 

{

 

Do nothing - allow normal load balancing to occur as it is an initial connection

 

}

 

else

 

{

 

Decode server address from persistence cookie

 

Check that the server the cookie points to is available

 

Send HTTP request to correct server

 

}

 

}

 

 

I would greatly appreciate any hints/tips on how to best solve the above problem.

 

 

Do you guys think an iRule is the best way to solve this?

 

Is there a better way to solve this?

 

If an iRule is the best way could somebody sketch up a starting point?

 

 

Thanks you very much for your time.

 

 

Regards,

 

Michael

2 Replies

  • Hi Michael,

     

     

    You should be able to add a OneConnect profile to the VIP to ensure that each HTTP request is parsed as you require. See this post for more info on the issue: Click here

     

     

    And for details on OneConnect configuration options, try searching AskF5 for solutions/manual entries for your version.

     

     

    Thanks,

     

    Aaron
  • Aaron,

     

    Thanks for your prompt reply.

     

    This did indeed solve the problem.

     

     

    After you mentioned it I was able to find a refernce in the "Configuration Guide for Local Traffic Management" document. Specifically Section 1 - Page 3

     

     

    ----

     

    The OneConnectTM feature contains the following components:

     

    ◆ Content Switching

     

    When an HTTP client sends multiple requests within a single connection, the LTM system is able to process each of those requests individually, sending those requests to different destination servers if necessary. This feature is enabled automatically and does not require configuration.

     

    ----

     

     

    Again thanks for your help.

     

     

    Michael