Forum Discussion

Rick_110395's avatar
Rick_110395
Icon for Nimbostratus rankNimbostratus
Jan 11, 2012

Pool Persistence while buiilding the page

I have an iRule that selects a pool based on the URI, but as the page is built subsequent requests do not match the initial condition directing it to the same pool. How do I get the conversation to stick to the original pool it was sprayed to?

 

 

Running 10.2.2 HF3

 

 

The initial request goes to test-pool-5002 because the URI contains "Test", but as the login page is built the browser makes several additional HTTP requests that do not contain "Test" which then get sent to prod-pool-5001.

 

 

 

when HTTP_REQUEST {

 

set uri [HTTP::uri]

 

if { $uri contains "Test" } {

 

pool test-pool-5002

 

} else {

 

pool prod-pool-5001

 

}

 

}

 

 

 

Pools

 

 

pool test-pool-5002 {

 

lb method member observed

 

action on svcdown reselect

 

monitor all tcp

 

members 10.20.20.70:5002 {}

 

}

 

pool test-pool-5001 {

 

lb method member observed

 

action on svcdown reselect

 

monitor all tcp

 

members 10.20.20.70:5001 {}

 

}

 

 

 

I have tried using cookie persistence with no luck. Is there a way to do this without splitting it out into two virtual servers? I am open to any solution.

 

3 Replies

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    There are a couple of ways around this. Persistence of some form (cookie, IP, etc.) should do the trick as once the pool is chosen the client should stick there throughout their connection. That should be the simplest way to go about things. I'm surprised you tried cookie persistence with no luck. What did your config look like? What was the behavior? Were there any errors showing in the logs?

     

     

    The other thing that is likely worth changing is the logic of the rule. If prod-pool-5001 is the default pool for all traffic that isn't going to the /Test page, then why include it in the iRule? Why not make it the default pool for the virtual, and leave it out of the iRule statement completely. This might make your persistence a little more ... persistent.

     

     

    Colin
  • There's a related example for persisting across pools in this thread:

     

     

    http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/2158969/showtab/groupforums/Default.aspx2234700

     

     

    Aaron
  • Try tried changing my iRule and just adding the prod-pool-5001 as the default pool, but got the same results

     

     

    when HTTP_REQUEST {

     

    set uri [HTTP::uri]

     

    if { $uri contains "Test" } {

     

    pool test-pool-5002

     

    }

     

    }

     

     

    I am going to try an iRule like the one in other thread.