Forum Discussion

chip_78360's avatar
chip_78360
Icon for Nimbostratus rankNimbostratus
Jan 14, 2010

BigIP and ASP.NET_SessionID issues.

We are moving our current application off of Cisco LB to a an F5 device. It is a .NET app which uses stateful sessions so we need to use the ASP.NET_SessionID to get back to the appropriate server. We had a custom irule written which does route new connections properly based on the session cookie. We found this was not sufficient for HTTP 1.1 connections from the client. The clients session cookie gets sent to multiple machines. We proved that the irule is working by running HTTP 1.0. Since every request will cause a new connection and therefore be balanced/re-balanced.

 

 

When using HTTP 1.1 from loadrunner -- and I assume the browser will have the same potential problem although I could not reproduce outside of loadrunner -- the client makes multiple concurrent connections associated with the first call default.aspx. Those initial connections come without the session cookie and get balanced across different servers. The response from the actual default.aspx page contains the Set-Cookie. After a cookie is received the client begins sending that cookie for requests to the already opened and established server connections. The problem is that the initial connections span multiple boxes and the session id is only valid on one of them. Everything works fine until dynamic content is requested on one of those rogue connections.

 

 

My assumption as to why the irule is "not working" is that the initial connection to the wrong machine was already established. The subsequent requests that contain the session id will not get "re-balanced". All new connections for that sessions will balance properly and this appears to be true. For my app to work I need every request to be rebalanced essentially.

 

 

From what I have found Cisco has a rebalance option. That appears to be what we are doing currently and why this beast works in production.

 

 

How would something similar be achieved in the F5 product? I find it hard to believe this is a new problem. There has to be a solution out there waiting for me to use.

 

 

thanks for any help

 

Chip

3 Replies

  • Hi Chip,

     

     

    I don't think standard HTTP clients use pipelining on the first request to a site. How would the client know what the second HTTP request on the same TCP connection should be if they haven't received the response content from the first request? They could use keep-alives and make multiple HTTP requests on the same TCP connection. But in that case, they would have to wait for the first response (which has the Set-Cookie with the ASP session ID) and then send that cookie in the subsequent requests.

     

     

    As a guess, you might try enabling a custom OneConnect profile. If you're using SNAT on the connection to the pool members, you can set the OneConnect source mask to 0.0.0.0. If you're not doing source address translation on the connection to the pool members, you can set the source mask to 255.255.255.255. See this wiki page for details on why you need to use OneConnect with cookie-based load balancing:

     

     

    http://devcentral.f5.com/wiki/default.aspx/AdvDesignConfig/oneconnect

     

     

    If that doesn't work, it would help to reproduce the loadrunner issue with HTTP 1.1 and capture a tcpdump to see exactly what is happening.

     

     

    Aaron
  • thx for the response. You have me thinking and I am wondering if this not a Loadrunner issue. All downloads that result from that initial page hit all go over without a SessionID. I assumed concurrent but it could be sequentially and just that LR is not setting the cookie for the static data.

     

     

    I do have a tcpdump that I can get and post.
  • I agree it's more likely to be a loadrunner issue if you don't see the problem when using a standard browser. If the client doesn't present a cookie that's sent to it, you're going to have problems trying to persist them back to the same server.

     

     

    Aaron