Forum Discussion
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.
- matthew_b_16251
Nimbostratus
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
- 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
Nimbostratus
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 } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com