Forum Discussion
Billy_chuang_16
Jun 16, 2008Historic F5 Account
HTTP request per second limit
Hi,
Is there any idea or example how to limit the HTTP request per second ?
Thx.
BR
Billy
Syed_Nazir_1624
Cirrus
Dec 06, 2014when RULE_INIT {
set static::allowedRate 10
}
when HTTP_REQUEST {
set count [table loolkup -notouch [HTTP::method] ]
if { $count eq "" } {
Add entry into table with count as 1 for 1 second
table add [HTTP::method] 1 1
} elseif { $count < $static::allowedRate } {
Increment count
table incr -notouch [HTTP::method] 1
} else {
No of HTTP request exceeded per second do your action here
HTTP::respond 503
}
}
--Formatted
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
