Hi,
Need help in configuring an irule for cache load balancing.
The customer has a group of 5 bluecoat proxies which are used to load balance all port 80 traffic.
The customer now has procured 2 additional bluecoat proxies which they want to use exclusively for caching any requests to “YouTube.com”.
So , the requirment is that any request to “Youtube.com” should go to these new 2 bluecoat proxies while all other http requests should go to the other 5 older bluecoat proxies.
I have written this following irule to do the same :
when HTTP_REQUEST {
if {[HTTP::uri] equals {http://www.youtube.com}}
{pool pool1}
}else pool pool2
}
}
Not sure if it’s correct or not.
Any help will be greatly appreciated.
Hi,
the [HTTP:uri] returns the path after the HOSTNAME so for example, the [HTTP::uri] value for www.dailymotion.com/test/video_funny.php would be: /test/video_funny.php. For more information check this: Click here
In your case it would be best to validate the HTTP::host value → Click here
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals "www.youtube.com"} {
pool pool1
} else {
pool pool2
}
}
You may want to filter the IP too of dailymotion since the client may want to reach it through the IP address directly :
Non-authoritative answer:
Name: www.dailymotion.com
Addresses: 195.8.214.141, 195.8.214.142, 195.8.214.140
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"www.dailymotion.com" -
"195.8.214.141" -
"195.8.214.142" -
"195.8.214.140" {
if {[active_members pool1] > 1]} {
pool pool1
else {
pool pool2
}
}
default {
pool pool2}
}
}
It may be more interesting to use a class if you add more stuff to filter to different bluecoat: Click here
Thanks a lot for your help. Will try the same on saturday on customer’s site and will let u know the results.
Hi ,
Will need further help on this.
The customer has now added a new requirment to the setup.
As , explained earlier , our client has a group of 5 bluecoat proxies with which the entire country’s http traffic is cached and the load balancing is done by a pair of BIGIP’S.
Now the customer has added two more bluecoats to the setup but these 2 bluecoats will only be used to cache "youtube’ traffic.
The irule that was suggested to me for this purpose was :
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals “www.youtube.com”} {
pool pool1
} else {
pool pool2
}
}
Now apart from it, the customer also wants that in case the pool of “2 bluecoat caches for you tube” fails under any circumstances , the traffic should atleast go to the "original cache of the 5 bluecoats " so that traffic to you tube is not interrupted.
So , how do i achieve this using an irule. Priority group activation will not work as both the pools are active.
Any help will be greatly apprecaited.
Hi ,
Thanks a lot for the updated irule.
Just need 1 more clarification though.
In the irule , is pool 1 - the old pool with 5 bluecoats for http caching
pool 2 - the 2 new bluecoats for youtube caching.
or is it viceversa ?
You might want to look up the election hash iRule on devcentral for some technical background on this type of problem.
Hi,
Pool1 is the bluecoat cache for dailymotion.
Pchang is right, you should have a look at this article that optimize all this for all your bluecoat: Click here