Jaymz_mynes_653
Nov 30, 2006Nimbostratus
Efficient iRule writing
I am getting ready to create some iRules and because the rules are going to cover a lot of area I am concerned about the efficiency in which they are written. Here is the scenario, I have just put together an IIS 6.0 webfarm that uses the BigIP v9 LTM as its load balancer. The previous implementation of our website relied heavily on access DBs (yuck, I know), some of those are gone, but some are still around, so what I have to do is create iRules that redirect (based on uri) to the first node in the farm. The first node houses those access DBs… I was happy to find out how easy it was, but then I started to worry about what the iRule was starting to look like when I was writing it.
Basically I have around 80 redirects I have to make, so do I…
-Create an iRule for each redirect (I hope not)?
-Put all of the redirects in 1 iRule using a more efficient method than "or"?
-Put all of the redirects in 1 iRule and use the Logical Operator “or” as many times as it takes? (Like below, but with many more redirects)
when HTTP_REQUEST {
if { ([HTTP::uri] contains "/Microsoft") or ([HTTP::uri] contains "/Cisco") or ([HTTP::uri] contains "/Photogallery") } {
node 10.102.180.69 80
}
}