Forum Discussion
One Virtual Server, Two Pools - different persistence profiles
Hello,
I have one virtual server that has two pools behind it. These pools are different applications. I use URI logic to redirect to each pool.
(i.e. URI eq "/" pool A else URI eq "/123" pool B"
The problem I am having is Pool A needs least balanced connections to equally distribute traffic.
Pool B on the other hand demands source address affinity.
I need help with an iRule that does this. Any tips?
2 Replies
- nathe
Cirrocumulus
Cjbarr1234,
Least connections is a load balancing algorithm and source address persistence deals with returning clients. Persistence will override load balancing. So they are distinct.
That being said. You can use the persist command to select a persistence method in an irule. See the following DC article Enabling Session Persistence with iRules
Hope this helps,
N
- cjbarr1234
Altostratus
Thanks Nathan. Would you have an example of how you would do this? This is something I came up with, but I don't fully know if it will work. Hopefully you can help me hash this out...
when HTTP_REQUEST {
log local0. "[IP::client_addr][TCP::client_port]: New HTTP request to [HTTP::host][HTTP::uri]" Select pool and persistence based on URI switch -glob [HTTP::uri] { FV "/*" { Select fv pool and no persistence pool fv_pool persist none log local0. "[IP::client_addr][TCP::client_port]: fv request" } PV "/pv*" { Select pv pool and simple persistence pool pv_pool persist srcaddr 300 log local0. "[IP::client_addr][TCP::client_port]: pv request" } PV "/pv/*" { Select pv pool and simple persistence pool pv_pool persist srcaddr 300 log local0. "[IP::client_addr][TCP::client_port]: pv request" } RFM "/rfm/" { Select rfm pool and simple persistence pool rfm_pool persist srcaddr 300 log local0. "[IP::client_addr][TCP::client_port]: no match for [HTTP::host][HTTP::uri]" } }}
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