OviShare_69630
Nov 02, 2009Nimbostratus
iRule Optimization
I have recently run into a performance logjam with my load balancer, and I need help! Without commenting on the logic of doing things this way (we know it is not optimal and are working on a better long-term solution), I need to know how to optimize the following iRule. The datagroup "restricted_URL_datagroup" has over 14,000 entries in it, and all access to that data has to be blocked with a 404 error. I think what I need to do is just ignore the rule entirely if the request comes in from either domain1.com or domain2.com and dump out of the rule on the first match in "restricted_URL_datagroup" rather than processing the entire datagroup. Don't know if any of that it possible. Looking for any help/suggestions. Thanks!
when HTTP_REQUEST {
set refer_host [string tolower [HTTP::header Referer]]
if { ( not ($refer_host contains ".domain1.com") ) and
( not ($refer_host contains ".domain2.com") ) and
( [matchclass [string tolower [HTTP::path]] contains $::restricted_URL_datagroup] ) } {
Block content
HTTP::respond 404 content ""
}
}