Increase TPS per host IP
Hi,
Our team is asking me to increase TPS per host IP from 30 to 90. They provided me an irule which is currently serving. According to team, this irule is limited for 30 TPS per host IP and I need to find right value for "maxRate, timeout and related" Can someone please help me in the modification of this rule and also explain what this irule do (step by step)? it will be really very helpful. Thanks in advance
when RULE_INIT {
set static::maxRate 900 * 3
set static::windowSecs 1
set static::timeout 30 }
when HTTP_REQUEST {
if { [HTTP::method] eq "GET" } {
set getCount [table key -count -subtable [IP::client_addr]]
log local0. "getCount=$getCount"
if { $getCount < $static::maxRate } {
incr getCount 1
table set -subtable [IP::client_addr] $getCount "ignore" $static::timeout $static::windowSecs
} else {
log local0. "Exceeded the number of requests allowed. $getCount"
HTTP::respond 501 content "Request blockedExceeded requests/sec limit."
return
} } }