Forum Discussion

James_Richter_1's avatar
James_Richter_1
Icon for Nimbostratus rankNimbostratus
Jul 16, 2009

iRule or HTTP Profile

We have about 80 sites (and growing) that will be run through our 6900. We use a single IP address and route to Pools based on host headers. We're currently using http profiles, but as the number of sites grows, I'm wondering if it wouldn't be better to use an iRule to redirect instead.

 

 

Any recommendations on performance/ease of administration? It seems like using an iRule would be easier to admin instead of creating all of those profiles, but I've heard that profiles performance is better than processing something through an iRule.
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    It's my understanding that the difference between using a simple iRule versus an HTTP class would be minimal. But maybe someone who has more concrete info can respond.

    From an administration point of view, I think for a handful of host header values to check, it might be nice to use the HTTP class as it doesn't involve iRules. But after you get more than a handful of HTTP classes, it becomes difficult to see them in the GUI. I think it's more personal preference. I'd opt for an iRule for more than 4 or 5 host headers.

    Another option would be to name the pool member based on the host header value(s) it will serve. You could then use an iRule which says if the request matches the form anything.example1.com use pool example1.com_pool. This could help you avoid listing out 80 hostnames in the pool. It would be even easier if there was a one to one mapping of hostnames to pools:

     
     when CLIENT_ACCEPTED { 
      
         Save the VIP's default pool name 
        set default_pool [LB::server pool] 
     } 
     when HTTP_REQUEST { 
      
         Try to select a pool based on the requested host header (www.example1.com -> www.example1.com_http_pool) 
         Use catch to trap the error and select the VIP's default pool 
        if {[catch { pool [string tolower [HTTP::host]]_http_pool }]}{ 
      
            We only get here if there was an error in trying to assign the pool from the host header 
           pool $default_pool 
        } 
     } 
     

    You can add logging to help debug the rule.

    Aaron
  • That is awesome suggestion, I will definately give that a try. I'm a little concerned about the amount of processing that happens every time someone hits those since this is for a high volume application, but I'll do some testing. Thanks again!