Forum Discussion

David_Mays_2065's avatar
David_Mays_2065
Icon for Nimbostratus rankNimbostratus
May 25, 2006

iRule question - somewhat complex challenge

My apologies in advance if this topic has been covered ad nauseum... I was unable to discover anything substantially similar through searching the forum.

 

 

I'm about to embark on a project that may end up making heavy use of iRules for some semi-fancy application load-balancing based on url inspection.

 

 

I believe I need to use iRules to inspect the url and perform the redirection to a given pool.

 

 

What I haven't been able to discover yet is what the "best practices" are for writing good iRules, and what specific things should be avoided.

 

 

From my initial look into iRules, I am imagining a large if/then/elseif statement or a case statement with a lot of contains or matches_regex evaluations in it.

 

 

In my scenario, I may have something like 6-8 webservers in 2-4 pools behind the F5.

 

 

Each of the webservers will host a different set of applications, stored under url paths which are unique to individual clients.

 

 

There could be a "large" number of different sites, each of which would receive its own rule, or entry in a large rule.

 

 

All urls would be in a format like http://my.domain.com/client/level1/level2/

 

 

my.domain.com is fixed for all sites.

 

client, level1 and level2 will vary.

 

 

The list of sites would be broken up among the various servers in some way as yet to be determined, and would be very dynamic and constantly changing. Because of the constant changes, another system would be making iControl calls to the F5 to Add/Remove Nodes, Update Pools and Add/Remove/Update iRules that let the F5 redirect the right URLs to the right pools.

 

 

Consider that there are probably 50 clients, each of which may have on average 50 sites at level1. Usually under level1 there are 1 or 2 sites at level2. So at a rough guess, there might be 5000 distinct sites to route traffic to, which could be split up on the different webservers based on things like anticipated load for the site, client importance, and other yet to be determined heuristics.

 

 

Fundamentally the goal is to remove a lot of the complexity of the resource allocation and load balancing from the F5 and put it into some external system which can independently monitor the load on the servers and re-allocate nodes into pools as required by dynamic demand changes.

 

 

My IT staff has a support call in to the F5 engineers for advice, but I am also always interested in different approaches, especially things that an "inside the box" corporate engineer might not suggest.

 

 

Thanks a ton for any help!

 

 

Dave

 

2 Replies

  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Hi Dave -

     

     

    This recent thread on a similar topic will probably get you started, esp if you take a look at the URI redirects example on the "findclass" wiki page: Click here.

     

     

    Post back if you have more questions.

     

     

    Good Luck!

     

    /deb
  • Would it be naive to suggest that you segregate the different types of clients and use a separate VIP for each group of clients? This might remove some of the complexity of managing the resources and creating the rules.

     

     

    Or is using one VIP a requirement?

     

     

    Aaron