Forum Discussion

m1978_295079's avatar
m1978_295079
Icon for Nimbostratus rankNimbostratus
Jun 16, 2017

Configuring Sticky session or Destination address affinity persistence

I need to configure sticky session in two pool members out of four. So the current set up is as below

 

Client ----https---F5 (offloading)--http-- Four Pool members

 

Now out of four pool member two of members needs to have sticky session as per design requirement. I have searched in internet and can see sticky session defined as Destination address affinity persistence in F5. Basically choosing des_add profile in VS. The problem here is designer does not want sticky session to all the pool members (four of them), only sepecific to two he wants sticky session to be attached to. How can this be achieved? If possible, please explain it with an example. It would be really helpful for me.

 

  • That requirement doesn't make sense to me as a standalone requirement. It only makes sense if there is an additional requirement - for instance some paths or file types get sent to the sticky server and some don't. Let's say your requirement is for js/css and images to be sent to the non-sticky servers and for all other requests to be sent to the dynamic servers.

      1. Create 2 pools pl_dynamic and pl_static.
      2. Create a virtual server vs_web with http, oneconnect and cookie insert (persistence) profiles
      3. Make pl_dynamic the default pool on vs_web
      4. Create the iRule ir_pool_select below and attach to vs_web

     

    when HTTP_REQUEST {
        switch -glob -- [HTTP::uri] { 
            "*.js" - 
            "*.css" - 
            "*.png" { 
                # Send to pl_static 
                pool pl_static 
                # Turn persistence off for the static pool 
                persist none 
                return 
            }
        }
    }

     

    Pulling my hair out - why can't I make this code formatting work?????