Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 25 Load Balancer Configuration : Understanding Load Balancing Options

Understanding Load Balancing Options
Load balancing is available for messages arriving from queues. Do not use load balancing for topic-based or other broadcast sources.
Two kinds of load balancing configuration are available: basic and content-aware load balancing. Both kinds support messages arriving from TIBCO Enterprise Message Service queue sources.
Every JMS destination that is configured to be an input destination runs in its own JMS Session. This provides good throughput on queues and topics for processing, and less connections.
Basic Load Balancing
With basic load balancing, events from queue sources are automatically distributed between deployed instances of an agent class. To set up this kind of load balancing, you deploy multiple instances of an agent class that listens to a JMS destination. Each deployed agent instance runs in a different processing unit.
Certain aspects of the design have to be managed by the application. See Designing for Concurrency for related information.
This method can be useful when there is no relationship between the events that would require them to be processed in a certain order. If the order or grouping of events received is important, use content-aware load balancing. Content-aware load balancing has other benefits also, as explained below.
Content-aware Load Balancing
With content-aware load balancing, all related events arriving from queues are routed to the same agent using a routing key. The key uses the value of a selected event property. For example, if the event property is ZipCode then a routing key is a specific zip code. All messages relating to one zip code are routed (over TCP) to the same agent, providing "session stickiness."
Content-aware load balancing uses routers and receivers. You can configure routers and receivers from the CDD Load Balancer tab. One receiver can handle more than one set of related events. For example if the routing key is a zip code, one receiver might handle events for multiple zip codes.
Use of content-aware load balancing simplifies project configuration, and makes runtime behavior more efficient. For example, only local locking is generally required (whereas basic load balancing requires cluster-wide locking). Also the L1 cache does not have to be checked for version consistency.
The following diagram shows the CDD based router and receiver configuration.
Routers
A router PU receives messages from the JMS server and routes them to appropriate receivers. Routers do no other work. For example, they should not execute rules.
A router PU contains one inference agent with one or more sets of JMS channels and destinations. Each destination has a default event. Values of one property of that event are used at runtime as routing keys.
Event preprocessors can be used as needed to populate the routing key property, for example using some calculation or combination of other event properties.
The router redirects events over TCP to a receiver, based on the destination and the routing key values. The router transparently distributes the load across the available receivers. If a receiver agent fails, its messages (that is, messages with the key that the router was sending to that agent) are routed to another receiver and continue to be handled by that other receiver.
Receivers
Receivers are the inference or query agents that do the actual work. A receiver PU contains one inference or query agent. A set of receivers belongs to the same agent class. Receivers can also do other work, in addition to the work they receive from the router.
With CDD configuration, a receiver agent class is configured with one of the channel and destination configurations defined in the router. The destination, however, functions as a pseudo destination.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved