Load balancing in Sonic ESB

Posted by tanmay.saha on 28-May-2008 20:10

All Replies

Posted by dmillman on 28-May-2008 20:25

Tammay

The ESB will automatically load balance across multiple instances of the same service, whether they be in the same or different container. If the service being invoked is in the same one as the proceeding one in the process then a local instance will normally be used and the service's threads will deal with this.

When the same service is deployed across multiple containers the service will automatically be load balanced as queues before the service will essentially act as the load balancer, or by default if topics are being used then shared subscriptions are used to automatically load-balance.

You can disable load balancing (only really required in a few use-cases) if you use topics but set the endpoint to not be in a shared subscription. The queue/topic behaviour is set in the endpoint definition of the service or process.

Hope this helps


David

Posted by jtownsen on 29-May-2008 02:23

To get the automatic load balancing that you're looking for, you should use a single instance of the service, deploying the same instance into multiple containers. For example, you would have one service named MRP.DBService deployed into multiple containers, instead of an MRP.DBService.ForContainer1, MRP.DBService.ForContainer2, etc.

Of course, using a single instance means you're using a single service endpoint, which, as Dave describes, is how the load balancing works. Using a single instance also ensures that the same startup parameters are used for each of the instances that will share the load.

Posted by tanmay.saha on 29-May-2008 12:03

Posted by dbenton99 on 05-Jun-2008 07:57

We have a scenario like that where we put a load balancer in between the ESB and the target web service. Our ESB process points to the load balancer address and it takes care of spraying the requests over the web service hosts. Alternatively, you could create two ESB processes (one pointing to server A and one pointing to server B) that are deployed using the same ESB entry endpoint. As the previous posts mention, the ESB would automatically load balance the requests over the listeners.

We preferred the load balancer approach because the maintenance side is easier.

This thread is closed