Forum Discussion

zeesh86_123075's avatar
zeesh86_123075
Icon for Nimbostratus rankNimbostratus
Jun 13, 2014
Solved

irule performance issue

We recently got bought out and I had to redirect about 800 URI's. I wrote three irules to accomplish this because I was crossing the character limit for each irule. I noticed that the website took quite sometime to redirect and caused alot of performance issue for this. Is there any way around this?

 

  • You should be using data classes for this task. Something similar to..

    when HTTP_REQUEST {
      if {[class match [HTTP::uri] equals myclass]} {
         HTTP::redirect [class match -value [HTTP::uri] equals myclass]
      }
    }
    

    Then define a string data class with your redirect requirements.

    Name                  Value
    /home                 http://newhome.host.com/home
    /home2                http://otherhome.host.com
    

8 Replies

  • You should be using data classes for this task. Something similar to..

    when HTTP_REQUEST {
      if {[class match [HTTP::uri] equals myclass]} {
         HTTP::redirect [class match -value [HTTP::uri] equals myclass]
      }
    }
    

    Then define a string data class with your redirect requirements.

    Name                  Value
    /home                 http://newhome.host.com/home
    /home2                http://otherhome.host.com
    
    • Kevin_Davies_40's avatar
      Kevin_Davies_40
      Icon for Nacreous rankNacreous
      This can be easily adapted for hosts, use [HTTP::host] instead of [HTTP::uri] and the name in the data class becomes the host name. Also we used the matching expression "equals"... there is also starts_with, ends_with and contains for more flexibility.
  • shaggy's avatar
    shaggy
    Icon for Nimbostratus rankNimbostratus

    In addition to Kevin's solution - newer versions of BIGIP handle data groups much more efficiently than older code levels, so perceived performance could also be impacted by the running code-level.

     

  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    I would just have a VIP to take all these requests at the F5 device and pass them to an Apache server at the backend to do all these redirects, which is a lot easier to set up and maintain.

     

  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    Well, at the minimum and at this point, it is easier to open a file of 600+ items with vi and do some global replacements there as needed, to me. :-)

     

    I used to have to handle 1200 URL redirects at one go that way in the past.

     

    But for each to his/her own way....

     

    • Kevin_Davies_40's avatar
      Kevin_Davies_40
      Icon for Nacreous rankNacreous
      Don't forget to tick the left of the post that provided the answer for you. This supports the volunteers who donate there time to help others on this site.