Trademarks. Third-Party Information. Jabber is a registered trademark of the Jabber Software Foundation. Acknowledgments, страница 8

When the load on an edge starts to scale down, so does its affinity value. Because the client always looks to connect to the edge with the lowest affinity value, this edge begins to take back connections that had spilled over into the next edge. The objective is to balance the number of connection requests to the available resources, and have all connections to the same application instance again pass through the same edge.

The client logic remains simple: to connect to the edge with the lowest affinity value. The client only needs to know the affinity value for the different edges in the cluster to make the connection to the right edge.

Clustering reverse proxies

Reverse proxies are configured to redirect incoming connection requests instead of outgoing connection requests, as is the case with explicit and anonymous proxies. The client’s request to connect to the desired application must first pass through the load balancer positioned before the cluster of reverse proxies before it reaches the origin server. When reverse proxies are deployed, the client's broadcast for a connection request cannot reach either an edge server or the origin server and the requested application. The URI for the proxy cluster or the origin server is not found on the client. Reverse proxying requires a different strategy for connecting clients and applications.

Clustering works efficiently when all clients that request the same application instance connect to the same edge server in the cluster, where the application is cached. To accomplish this efficiency with reverse proxying requires a multistep procedure.

1.  The client sends an HTTP request that includes an XML.load call to the origin server: http://origin[:<port>]/fms/fpad?uri=<uri>

2.  The load balancer on the remote network intercepts the request and routes it to one of the edge servers in the cluster.

3.  This edge server then acts as an FPAD client and broadcasts an FPAD message.

4.  The edge servers enrolled in the cluster respond with their affinity values.

5.  The broadcasting edge server chooses the edge server with the lowest affinity value.

6.  This edge server sends the required information back to the client:

<?xml version=\"1.0\" encoding=\"utf-8\" ?>

<fpad>

<proxy>10.133.192.85:1935</proxy>

<timestamp>627539012</timestamp>

<userdata></userdata>

</fpad> where the <proxy> tag contains the host:ip address of the edge server to connect to.

7.  The client then uses the information to make an explicit connection: first to the edge, then to the origin server using a wrapped URI:

nc = new NetConnection(); nc.onStatus = function(info)

{ trace(info.code);

} uri = "rtmp://yourcompany.com/app/inst"; myXML = new XML();

myXML.onLoad = function(success)

{ if (success)

{ var proxy = this.childNodes[1].childNodes[1].firstChild.nodeValue; uri = "rtmp://" + proxy + "/?" + uri;

} nc.connect(uri);

}

myXML.load("http://yourcompany.com/fcs/fpad?uri=" + uri);

The /fcs/fpad? code in the XML.load() URI tells the edge server that it needs to broadcast an FPAD message using the URI named uri, as specified.

Setting up origin and proxy servers

Use the following guidelines as you install and configure the origin and proxy servers. Using these guidelines helps ensure satisfactory performance and results:

■ Make sure your Macromedia license permits you to use proxy servers or a proxy cluster.

■ Deploy all proxy and origin servers on identical computers.

■ Use the same operating system (Linux or Windows) on all computers to avoid conflicts with filenames.