Forum Discussion
engtmk
Nimbostratus
Dec 27, 2007bigip1 panic: unable to alloc 4194304 bytes
I found this error in my LTM log, when I asked the support he said:
that TCL was trying to resize the ::users array (internal hash table) with an index of "time,200.35.63.129", and it crossed the 4MB boundary
so I need to know if there is a way to prevent this variable from exceeding the 4MB memory limit
below you will find the iRule that caused the error:
when RULE_INIT {
set ::maxconnect 80
set ::blocktime 120
array set ::users { }
array set ::spammers { }
}
when CLIENT_ACCEPTED {
set clientip [IP::remote_addr]
log local0. "the client ip is $clientip"
if { [matchclass [IP::remote_addr] equals $::smtp_whitelist ] } {
Accept unlimited connections from the whitelist users
return
}
set clientip [IP::remote_addr]
set now [clock second]
if { [ info exists ::spammers($clientip) ] } {
if { $::blocktime > [expr { $now - $::spammers($clientip) }] } {
the user tries to connect in the blocktime period
set ::spammers($clientip) $now
TCP::respond "550 Message Rejected - Too Much spam/r/n"
log local0. "The user tries to send while in the block period - $clientip"
drop
return
}
else {
the timeout has expired free the user from the list
unset ::spammers($clientip)
log local0. "The user has been removed from the list - $clientip"
}
}
if { [ info exists ::users(nb,$clientip)] } {
if { [expr { $now - $::users(time,$clientip) }] > $::blocktime } {
the last connection was before the timeout period
set ::users(nb,$clientip) 1
set ::users(time,$clientip) $now
return
}
else {
the connection was in the timeout
incr ::users(nb,$clientip)
set t $::users(nb,$clientip)
log local0. "the user - $clientip - has been connected $t times"
set ::users(time,$clientip) $now
if { $::users(nb,$clientip) > $::maxconnect } {
the user has exceeded the max no of connections
add him to the spam list
set ::spammers($clientip) $now
set ::users(nb,$clientip) 1
set ::users(time,$clientip) $now
TCP::respond "550 Message Rejected - Too much spam\r\n"
log local0. "this user has started spamming us $clientip "
drop
return
}
}
} else {
new client
set ::users(nb,$clientip) 1
set ::users(time,$clientip) $now
log local0. "this is user has just connected - $clientip"
}
}
Thanks for the help
12 Replies
- hoolio
Cirrostratus
The only suggestion I can think of is to schedule a maintenance window to test this further.
Aaron - engtmk
Nimbostratus
thanks for your help
okay I will try to do so
but please note that the first the iRule you suggested to me was not working and the error was that it cant read the field 1 in statment getfiled so I searched for the syntax for the command and I fix it (or I think so) but afterwards it refuses to work it does not remeber the user after it has been added to the array.
so maybe you can revise your very first suggestion and modify it(get field)
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
