For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

matthew_b_16251's avatar
matthew_b_16251
Icon for Nimbostratus rankNimbostratus
Nov 25, 2015

Device Load Balacing on Device Header Information

Hi All,

 

I need some help with the below irule we have created a vip with a one connect profile and applied the below irule. When a connection has X-DeviceID or new X-NewCust header we want the persistence for stay with one server for 5 minutes which we have got working with the below by creating a universal persistence xxx_universal. The problem is the next unique device that connect will also be redirect to the same node and not load balanced. Is there way to distribute these HTTP connections?

 

when HTTP_REQUEST { if { [HTTP::header exists "X-DeviceID"] } { persist universal xxxx_universal } elseif {[HTTP::header exists "X-NewCust"] } { persist universal xxxx_universal } else { persist source_addr } }

 

Many Thanks in advance Matt

 

4 Replies

  • Hi,

    The value of the header you are using for the persistence needs to be unique and not shared among users. For example if you want to persist based on headerABC then:

    if { [HTTP::header exists headerABC] } {
        persist uie [HTTP::header headerABC]
    }
    

    Anytime F5 recognizes a persisted value of headerABC, it'll direct the request to the same member based ont the peristence table entry for that value.

    Hope that helps.

  • How can we set the persist to last only 5 minutes on the HTTP Connect for devices with the required header? Also if a new request comes in with the same match on another connection would the persist extend 5 minutes?

     

    Thanks Matt

     

    • Amine_Kadimi's avatar
      Amine_Kadimi
      Icon for MVP rankMVP
      To persist 5 minutes: persist uie [HTTP::header headerABC] 300 and yes, whenever a peristence record is matched, the 5 minutes timer resets.
    • matthew_b_16251's avatar
      matthew_b_16251
      Icon for Nimbostratus rankNimbostratus
      Ok so something like below.. Thanks for your help will test this. when HTTP_REQUEST { if { [HTTP::header exists X-DeviceID] } { persist uie [HTTP::header X-DeviceID] 300 } elseif {[HTTP::header exists X-NewCust] } { persist uie [HTTP::header X-NewCust] 300 } else { persist source_addr } }