Forum Discussion
Kevin_106976
Jul 16, 2010Nimbostratus
Distribute load based on uri
Hi,
I want to distribute load across two uri's (/some/uri1 and /some/uri2) on a 70/30 percentage basis. Can I do this via an iRule ?
The_Bhattman
Jul 25, 2010Nimbostratus
Hi Kevin,
I wrote up a conceptual iRule that lcould represent what you are looking for. It's not elegant in my opinion, but at the very least should provide you with some ideas of how to write one up.
when RULE_INIT {
set counter 0
}
when CLIENT_ACCEPTED {
if {$::counter <= 7} {
The first 7 connections go to Server A for URI 1
pool member
incr $::counter
} elseif {$::counter <= 10 } {
The next 3 connections go to server B for URI 2
pool member
incr $::counter
} else {
Reset the counter when 11th connection is reached and go to SERVER A for URI 1
set $::counter 0
pool member
}
}
I hope this helps
Bhattman
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects