NiHo_202842
Sep 14, 2016Cirrostratus
Unusual high CPU cycles on iRule
Hi, So I am using the following iRule on all virtual servers & just enabled timing on this:
priority 50
when RULE_INIT {
set static::maindatalist
set static::debug 0
}
when HTTP_REQUEST {
return the company logo from ifile
if { ([HTTP::uri] eq "/bip-company-logo.gif") }{
HTTP::respond 200 content [ifile get /Common/company-logo]
return
}
set vs [virtual name]
if {($static::debug == 1)}{ log local0. "VS is $vs, looking at $static::maindatalist" }
set status [class match -value "[virtual name]" equals "maintenance-list"]
if {($static::debug == 1)}{ log local0. "Looked up status: $status" }
if { ($status eq "1") } {
if { ([HTTP::uri] eq "/favicon.ico") }{
HTTP::respond 404 content ""
return
}
set contact "Application Support () or your Regional Helpdesk"
if {([virtual name] starts_with "/ITSS/")}{
set contact "your Regional Helpdesk"
}
if {($static::debug == 1)}{ log local0. "Showing maintenance page" }
HTTP::respond 200 content "
Down for maintenance - company
Maintenance
This application is currently undergoing maintenance.
It should be available again within the specified time period.
For any questions, please contact $contact.
" Connection Close
return
}
}
when LB_FAILED {
set contact "Application Support () or your Regional Helpdesk"
if {([virtual name] starts_with "/ITSS/")}{
set contact "your Regional Helpdesk"
}
HTTP::respond 503 content "
Application Unavailable - company
Application unavailable
This application is currently not available.
Please contact $contact.
" Connection Close
return
}
(378 requests)
RULE_INIT: 5900 min, 12300 avg, 12300 max
LB_FAILED: 46000 min, 60200 avg, 167000 max
HTTP_REQUEST: 21300 min, 44000 avg, 384900 max
I used the F5DevCentral_iRulesRuntimeCalculator to calculate the CPU usage, coming down to 28% max CPU usage per request. This seems VERY high. Is there anything I can do about this? I tested with a healthy node & a disabled node, no maintenance mode.