Forum Discussion
AllrecipesDCO_1
Nimbostratus
Mar 12, 2014Re-balance requests from a single client
Hello,
We have an internal device hitting our public site with a large number of requests per second, and due to persistent connections (and the rate at which the requests are coming in from the...
Mar 12, 2014
Try this one:
when RULE_INIT {
set static::lifetime 60
set static::requestlimit 10
}
when LB_SELECTED {
if { [HTTP::header "User-Agent"] contains "Mozilla" } {
Add a table entry with a lifetime in seconds of the value of $lifetime.
table add [IP::client_addr] 1 indefinite $static::lifetime
if { [table incr [IP::client_addr]] > $static::requestlimit } {
If the user has surpassed the request limit the pool member is reselected
log local0. "This server was selected: [LB::server]"
LB::reselect
log local0. "Selected [LB::server]"
}
}
}
/Patrik
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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