Forum Discussion
Rate limit http and https requests globally
Hi @ll
I'm looking for a way to rate limit the requests/sec for all vServices and take an action like displaying a "we are overloaded" page when the requests/sec reaching a specific limit of requests. This shouldn't depend on ip addresses.
It wouldn't be a problem to do this for one specific vService - but I'd like to have this globally through all http and https requests through all vServices. We are running a BIG IP 4200
Thanks in advance, mat1010
1 Reply
I guess you could do this with tables, but you'd have to assign this to all virtual servers and they'd have to use an HTTP profile.
Try something like this?
when HTTP_REQUEST { set lifetime 1 set requestlimit 10 Add a table entry with a lifetime in seconds of the value of $requestlimit. table add "Globalcount" 1 indefinite $lifetime set currentcount [table lookup -notouch Globalcount] if { $currentcount < $requestlimit } { table incr -notouch "Globalcount" HTTP::respond 200 content "All fine" } else { HTTP::respond 503 content "Limit reached $currentcount" } }/Patrik
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