Forum Discussion

Brandon_Burns_8's avatar
Brandon_Burns_8
Historic F5 Account
Apr 02, 2008

iRule Optimization help

I have this iRule that works, but it seems there should be a way to do this more efficiently. Can anyone help out with this? I don't know if the switch command would be of an value here.

 

 

Thanks

 

 

 

when CLIENT_ACCEPTED {

 

if {[

 

matchclass [IP::local_addr] equals $::NG_Bypass_IP] or [active_members NG_Pool] == 0 and [active_members Cache_Pool] == 0 or not [matchclass [IP::client_addr] equals $::NG_Clients] } {

 

forward

 

}

 

elseif {

 

[active_members NG_Pool] > 0} {

 

pool NG_Pool

 

}

 

elseif {

 

[active_members Cache_Pool] > 0 and not [matchclass [IP::local_addr] equals $::Cache_Bypass_IP]} {

 

pool Cache_Pool

 

}

 

else {

 

forward

 

}

 

}

 

 

when LB_FAILED {

 

reject

 

}

 

 

1 Reply

  • From what i see i don't see how the switch is going to work for you. However, what you can do is check is how well it is evaluating the irule. Click here if you want to take a look at "timing on" which allows you to collect statistics.