Dbow_21284
May 19, 2011Nimbostratus
More efficient iRule needed
Hello,
I have a Virtual Server that I just setup for SharePoint. SharePoint hosts about 15 sites which the business lines all want Load Balanced. The challenge for me was that I did not want to setup a virtual server for every site. So I consulted DEVCENTRAL and looked for solutions to this. What I read about and came up with is a single virtual server that would use an iRule to direct traffic to pools for each site. Meaning that a pool would be setup for each site. This sounded great because it would allow me to have a separate monitor for each site.
Here goes an example of the iRUle:
when HTTP_REQUEST
{ if { [HTTP::host] equals "AAA.mydomain.org" } {
if {[active_members SP_AAAA] > 0} {
pool SP_AAAAA }
else {
HTTP::redirect "http://maintenance.mydomain.org"
event disable all
}
}
elseif { [HTTP::host] equals "BBB.mydomain.org" } {
if {[active_members SP_BBBB] > 0} {
pool SP_BBBB }
else {
HTTP::redirect "http://maintenance.mydomain.org"
event disable all
}
}
elseif ..... YADA YADA YADA...
This goes on for 13 other sites!!! So I realize this is very inefficient. Everytime the user makes a request it has to pass this iRule and therefore performance sucks. If I remove it it works fine. And looking at this now, it make sense why I see these results.
So my question is ... how do I make this better? Should I just make a virtual server for each site? iRules seem like it would be very inefficient in this case. Or is there a way to do this on a connection basis instead of each HTTP request basis?
Your assistance and enlightenment is appreciated!!!
Thanks!!!
Dbow