Tuesday, November 1, 2011

How to configure load-balancing across services on the same host

There is a neat feature in the Vordel Gateway v6.2 which allows you to load-balance messages across endpoints that are on the same host. In the configuration of a Vordel Gateway, we have had the concept of a "Remote Host" for a long time. A Remote Host allows you to assign an address to map to one or more addresses. This allows you to perform load-balancing across back-end machines which the Vordel Gateway routes to.

You can see in the configuration below that I have setup a Remote Host using Policy Studio, and I have setup three addresses which differ only on the port they use. I am calling the Remote Host "LoadBalancedRequests". This is not a name of a real machine, but that doesn't matter (think of a hosts file). Now, when I route messages to this LoadBalancedRequests destination, the Gateway load-balances the requests across three addresses, which differ only based on port. You can see also that I have set the load-balancing algorithm to be "weighted by response time".

By the way, you might be thinking "why would someone have three different endpoints on the same machine to load-balance over?". One good reason is if they are running three different app server instances, to take efficient advantage of the available CPU and memory. This scenario is actually quite common. So now you know how to accomodate it on the Vordel Gateway :-)