Forum Discussion
Richard__Harlan
Feb 10, 2006Historic F5 Account
Possable Rule crashing Unit
First off I opened a case with support. Just was hope one of the iRules export would see a problem with the rule. If seem every time we have user testing there site witch has these rule attach to it it causes the bigip to core. Attach are the rules. Thanks
gzip_stop {
when HTTP_REQUEST {
if { [HTTP::header exists "Accept-Encoding:"] } {
HTTP::header replace "Accept-Encoding:" deflate
log "header changed"
}
}
}
WindChill_HTTP_Links {
when HTTP_REQUEST {
set check_content 1
Don't allow data to be chunked.
if {[HTTP::version] == "1.1"} {
if {[HTTP::header is_keepalive]} {
Adjust the Connection header.
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
when HTTP_RESPONSE {
if {$check_content == 1} {
set replace_now 1
log "replace now"
Calculate the amount to collect
set content_length 0
if {[HTTP::header exists "Content-Length"]} {
set content_length [HTTP::header "Content-Length"]
}
If the header is missing, use a sufficiently large number
if {$content_length == 0} {
set content_length 4294967295
}
HTTP::collect $content_length
log "collect"
}
}
when HTTP_RESPONSE_DATA {
log "Response"
set payload [HTTP::payload [HTTP::payload length]]
set windchilllinks "https://cfwctest3.deere.com"
Find HTTP Links and change to HTTPS links
if { [regsub -all -nocase {http://cfwctest3.deere.com} $payload $windchilllinks new_response] > 0 } {
Replace the content if there was any matches
HTTP::payload replace 0 [HTTP::payload length] $new_response
log "data changed"
}
}
}
- Have you put any logging in place to determine which part of your rules is the culprit. The one thing that sticks out at first glance is that you are using regsub to build an entire new copy of the payload which could be quite memory intensive depending on the size of your response. My guess is it's either the regsub or HTTP::payload replace but there's now way to know without some logging.
when HTTP_RESPONSE_DATA { set find "http://cfwctest3.deere.com" set replace "https://cfwctest3.deere.com" set offset 0 set diff [expr [string length $replace] - [string length $find]] Get indices of all instances of find string in the payload set indices [regexp -all -inline -nocase -indices $find [HTTP::payload]] foreach idx $indices { set start [expr [lindex $idx 0] + $offset] set end [expr [lindex $idx 1] + $offset] set len [expr {$end - $start + 1}] replace the instance of find with the contents of replace HTTP::payload replace $start $len $replace modify offset if the replace string is larger or smaller than find. incr offset $diff } }
- Richard__HarlanHistoric F5 AccountIt does look like we are running into the 4mb rule limit for memory. How much memory would you change save us? Also if we convert to the Stream profile would be be able to get around the 4mb limit? Thanks
- I guess I should have mentioned the stream profile. Thinking of this now, it's probably your best option.
- Gerald_Chisholm
Nimbostratus
Is there a way to tell how much memory is being used by a Rule and its classes? - You can turn on time profiling on a rule with the "timing on" command
- unRuleY_95363Historic F5 AccountTry 'tmctl mem' and look at the rules and tcl rows.
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