Sekou_Page_1118
Apr 26, 2006Nimbostratus
HTTP_Request URI performance question
I would like to know which type of request is more efficient as iRules get longer. We have a need to direct clients to specific pools of web servers depending on the URL they used. However, we have literally hundreds of URLS, which means very long iRules. We are looking into changing this (I have another post on this for suggestions).
Anyway, here are the two types of rules we can use... Keep in mind that the actual rules would be for several hundred URLS. So if anyone out there knows of a performance difference between these two types of rules, please let me know. Thanks!Example1:
when HTTP_REQUEST {
if { [HTTP::uri] contains "/c1/"} {
pool WEB02
}
elseif { [HTTP::uri] contains "/c2/"} {
pool WEB02
}
elseif { [HTTP::uri] contains "/d1/"} {
pool WEB01
}
elseif { [HTTP::uri] contains "/d2/"} {
pool WEB01
}
} else {
pool WEB03
}
}
Example2:
when HTTP_REQUEST {
if { [HTTP::uri] contains "/c1/" or [HTTP::uri] contains "/c2/"} {
pool WEB02
}
elseif { [HTTP::uri] contains "/d1/" or [HTTP::uri] contains "/d2/"} {
pool WEB01
}
else {
pool WEB03
}
}