Forum Discussion

katic_13597's avatar
katic_13597
Icon for Nimbostratus rankNimbostratus
Jul 14, 2007

increase the IRULE Performance ?

I am new to IRULEs ,I have an IRULE by which my Product Performance becomes Very slow, when HTTP requests are going via Big-IP IRULE the Performance is 2-requests per second , if we hit with HTTP request Directly to the server the Performance is 24 –Requests per second.

 

 

My IRULE:

 

when HTTP_REQUEST {

 

if { [HTTP::uri] contains "/myServer/one/"} {

 

pool dvsnode1_pl1

 

}

 

elseif { [HTTP::uri] contains "/myServer/two/"} {

 

pool dvsnode2_pl1

 

}

 

else { pool dvsnode_general_pl1

 

}

 

}

 

 

Can anybody please optimize my IRULE whether I have to use IF-else or switch to gain the performance, any way we can see how much time IRULE is taking for Processing the HTTP request.

 

 

Help will be appreciated.

 

 

7 Replies

  • kirkbauer ,thanks for the reply.

     

    My URL looks like "http://+:995/myServer/one/Device/" , is "starts_with" with works for me ?

     

     

    i have seen "starts_with" for operator is an operator designed specifically to match only the beginning of the string.

     

     

    Do you want me to use "starts_with" over Switch? or continue with if-elseif ?

     

    thanks
  • My URL looks like "http://+:995/DvsServer/one/Device/" , is "starts_with" with works for me ?

     

     

     

     

    Yes, it will work. The HTTP header doesn't actually contain the entire URI but just the local part of it. If what you see in your browser's address field is "http://servername:995/DvsServer/one/Device/", [HTTP::uri] will only return "/DvsServer/one/Device/". The protocol, server name and port number are not returned.

     

     

    Using the starts_with operator, as kirkbauer suggested, will save the iRule the trouble of always scanning through (nearly) the entire URI for occurrences of your search string. Instead, as soon as the first non-matching character is encountered, the iRule can skip the rest of the URI.

     

     

    Using switch instead of if/elseif might be a bit more effective, but there shouldn't be a major difference, since most of the work is caused by the string comparison operations, and exactly the same comparisons must be done in both cases.
  • As you've found, there shouldn't be much of a difference between these different methods in the iRule. I would expect that the iRule wouldn't add any significant latency. It definitely wouldn't account for the drop in performance you've described. Take a look at your other post for suggestions on using tcpdump to troubleshoot the issue.

     

     

    Aaron
  • My guess is that your performance issues are related to configuration stuff other than the iRules. There's no way an iRule should slow you down that much.

     

     

    When I was doing an eval for the F5 stuff last year we had a number of performance issues initially, and they were all solved by tweaking the network profiles (mostly the TCP profile, but the HTTP profile may also be relevant). It might be worth looking at your other network settings and see if anything there can be improved.

     

     

    Sorry I can't be more specific, but this was almost exactly a year ago and I haven't really played with those settings since I don't really remember exactly what was done.
  • Any hints on what you did change in the TCP profile aswell as HTTP profile?