Comments on: Blue Coat ProxySG Appliances Load Balancing & High Availability https://blog.michaelfmcnamara.com/2008/08/blue-coat-proxysg-appliances-load-balancing-high-availability/ technology, networking, virtualization and IP telephony Sat, 30 Oct 2021 14:40:12 +0000 hourly 1 https://wordpress.org/?v=6.7.3 By: Michael McNamara https://blog.michaelfmcnamara.com/2008/08/blue-coat-proxysg-appliances-load-balancing-high-availability/comment-page-1/#comment-4964 Wed, 05 Oct 2011 23:38:50 +0000 http://blog.michaelfmcnamara.com/?p=272#comment-4964 In reply to Russell.

Hi Russell,

As you probably know you can’t achieve a true active/active configuration but you can get pretty close by utilizing a PAC file with the appropriate JavaScript. In my example script above I evaluate the fourth octet of the client IP address to make a decision regarding which proxy server to return. This helps provide some “load-balancing” between the clients but assures that the same client always queries the same proxy server – easier for troubleshooting and caching of site related information.

You can achieve redundancy by returning two proxy servers in the string. Internet Explore will try the first and if unable to connect will try the second.

return "PROXY proxy.example.com:8080; DIRECT";

In the example above I’m using proxy.example.com but if that does not respond the browser will attempt a direct connection.

Good Luck!

]]>
By: Russell https://blog.michaelfmcnamara.com/2008/08/blue-coat-proxysg-appliances-load-balancing-high-availability/comment-page-1/#comment-4950 Tue, 04 Oct 2011 06:56:28 +0000 http://blog.michaelfmcnamara.com/?p=272#comment-4950 For one of my deployment, i want Active / Active configuration in two location Data center and Disaster recovery site. I don’t have much idea about this scripting. Can you please give me some idea? DC and DR are not in same broadcast or multicast domain. I just saw your wpad conf and write mine.

will my below wpad conf work?

BackupRoute=”DIRECT”;
UseDirectForLocal=true;
function MakeIPs(){
this[0]=”172.16.102.20″;
this[1]=”255.255.255.255″;
this[2]=”172.25.61.50″;
this[3]=”255.255.255.255″;
this[4]=”10.10.10.100″;
}
DirectNames=new MakeNames();
cDirectNames=24;
cNodes=1;
function MakeProxies(){
this[0]=new Node(“172.16.1.236:8080”,0,1.000000);
}
Proxies = new MakeProxies();
function Node(name, hash, load){
this.name = name;
this.hash = hash;
this.load = load;
this.score = 0;
return this;
}
function FindProxyForURL(url, host){
var urlhash, ibest, bestscore, list, i, j;
var DCVIP1 = “PROXY 172.16.1.236”;
var DRVIP1 = “PROXY 172.16.20.222”;

if (UseDirectForLocal && isPlainHostName(host))
return “DIRECT”;
if (cDirectNames > 0)
for (i = 0; i 0)
for (i = 0; i < cDirectIPs; i += 2)
if (isInNet(host, DirectIPs[i], DirectIPs[i+1]))
return "DIRECT";
urlhash = HashString(url);
for (i = 0; i < cNodes; i++)
Proxies[i].score = Proxies[i].load * Scramble(MakeInt(urlhash ^ Proxies[i].hash));

if ( (ipSubs[3] % 2) == 0 )
{
return DCVIP1 + ":8080";
} else
{
return DRVIP1 + ":8080";
}

list = "";
for (j = 0; j < cNodes; j++) {
for (bestscore = -1, i = 0; i bestscore) {
bestscore = Proxies[i].score;
ibest = i;
}
}
Proxies[ibest].score = -1;
list = list + “PROXY ” + Proxies[ibest].name + “; “;
}
list = list + BackupRoute;
return list;
}
function HashString(url){
var h = 0;
var slashes = 0;
for (var i = 0; i < url.length; i++) {
var c = url.charAt(i);
if (c == '/')
slashes++;
if (slashes < 3)
c = c.toLowerCase();
h += (((h & 0x1fff) <> 13) & 0x7ffff)) + CharToAscii(c);
h = MakeInt(h);
}
return h;
}
function Scramble(h){
h += ((h & 0xffff) * 0x1965) + ((((h >> 16) & 0xffff) * 0x1965) << 16) + (((h & 0xffff) * 0x6253) << 16);
h = MakeInt(h);
h += (((h & 0x7ff) <> 11) & 0x1fffff));
return MakeInt(h);
}
var Chars =” !\”#$%&\'()*+,-./0123456789:;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~??????????????????????????????????????????????????????????????????a??????????????????????? “;
function CharToAscii(c){
return Chars.indexOf(c) + 32;
}
function MakeInt(x){
if (x = 4294967296) {
return x – 4294967296;
}
return x;
}

]]>
By: Century https://blog.michaelfmcnamara.com/2008/08/blue-coat-proxysg-appliances-load-balancing-high-availability/comment-page-1/#comment-964 Mon, 22 Jun 2009 13:05:44 +0000 http://blog.michaelfmcnamara.com/?p=272#comment-964 Hy Michael,

you wrote “If you wanted geographic redundancy you could alter the “return” statement like so;
“PROXY 10.1.127.62:8080; 10.2.127.62:8080″
In this case the browser will attempt to contact the proxy server at 10.1.127.62:8080 and if the browser is unable to contact that proxy it will then try the proxy server at 10.2.127.62:8080. You’ll need to make sure that you include the (semicolon) “;” between each proxy server.”

How does the browser check that theres no proxy on 10.1.127.62. Does it check how long the proxy is unavaible or is it possible to check errors like http404 if the proxy is unavaiable ?

thanks
tom

]]>
By: Michael McNamara https://blog.michaelfmcnamara.com/2008/08/blue-coat-proxysg-appliances-load-balancing-high-availability/comment-page-1/#comment-701 Tue, 24 Mar 2009 22:23:32 +0000 http://blog.michaelfmcnamara.com/?p=272#comment-701 Hi Dean,

There are a number of ways you could host the PAC file in a high availability fashion. You could placed the PAC file on two servers in a server farm that are front-ended by a Layer 7 load balancing switch. You could placed the PAC file on a Windows server that belongs to a Microsoft Cluster.

In my case I’m currently hosting the PAC file on my Intranet website. Since the Intranet is already in a high-availability configuration (two redundant Nortel Application Switch 2216s) it didn’t cost me anything. If you already have a similar solution you might want to host the PAC file within that solution and save yourself the effort and cost of building out a dedicated solution.

Good Luck!

]]>
By: Dean Fuller https://blog.michaelfmcnamara.com/2008/08/blue-coat-proxysg-appliances-load-balancing-high-availability/comment-page-1/#comment-700 Tue, 24 Mar 2009 16:23:37 +0000 http://blog.michaelfmcnamara.com/?p=272#comment-700 How do you get over the PAC file hosting being the single point of failure now?

]]>
By: Michael McNamara https://blog.michaelfmcnamara.com/2008/08/blue-coat-proxysg-appliances-load-balancing-high-availability/comment-page-1/#comment-237 Wed, 03 Sep 2008 00:36:39 +0000 http://blog.michaelfmcnamara.com/?p=272#comment-237 Thanks for the comment Jim.

]]>
By: Jim https://blog.michaelfmcnamara.com/2008/08/blue-coat-proxysg-appliances-load-balancing-high-availability/comment-page-1/#comment-236 Wed, 03 Sep 2008 00:35:29 +0000 http://blog.michaelfmcnamara.com/?p=272#comment-236 Thanks for the information this should really help me out!

]]>