Forum Discussion
Photo_G_84660
Nimbostratus
Jul 07, 2006Array element limitation question
Hi,
I'd like to ask whether there is a limit to the maximum number of elements that an iRule array can store and parse. I’m curious, because I'd like to understand the impact of utilizing the following modified version of the LimitConnectionsFromClient iRule found at: http://devcentral.f5.com/wiki/default.aspx/iRules/LimitConnectionsFromClient.html. This looks like an excellent way to throttle connections to a VIP, but I'm concerned that it might also create a massive array that drives the BIG-IP CPU into the ground. Any input would be appreciated.
when RULE_INIT {
array set ::active_clients { }
}
when CLIENT_ACCEPTED {
set client_ip [IP::remote_addr]
if { [info exists ::active_clients($client_ip)] } {
if {$::active_clients($client_ip) > 5 } {
log "$client_ip has exceeded the SLA"
reject
event CLIENT_CLOSED disable
return
} else {
log local0. "$::active_clients($client_ip)"
incr ::active_clients($client_ip)
}
} else {
set ::active_clients($client_ip) 1
}
}
when CLIENT_CLOSED {
if { [info exists ::active_clients($client_ip)] } {
incr ::active_clients($client_ip) -1
if { $::active_clients($client_ip) <= 0 } {
unset ::active_clients($client_ip)
}
}
}
Thanks in advance,
Scott H.
1 Reply
- Photo_G_84660
Nimbostratus
Thanks a million!
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