[Users] Load balancing features

vzurczak vincent.zurczak at petalslink.com
Tue Mar 15 11:09:09 CET 2011


Hi, :)

Here are some explainations about Petals' load balancing mecanisms.

First, you must remember that Petals can be distributed. It means you may have several instances of Petals that run on different machines and that communicate together. As an example, you may have one consumer deployed on one machine (node) and the associated service providers deployed on other nodes. The invocation will be made transparently, just like if they were all on the same node. This answers one of your questions. Petals supports heteregenous hardware because each server has its own instance of Petals. And this instance can communicate with others. The only requirement is to have a communication network.

Then, here is what we mean by load balancing.
It means that the choice of a service provider (when a consumer requests it) is made in the bus according to certain routing criteria.
So, in Petals, load balancing is equivalent to message routing. It is different from the clustering approach.

Currenty, there are two routing strategies.
The first one is random: among all the valid providers, we select one randomly.
The second one is a proximity criteria: we can define priorities on what nodes should be chosen. We can either give priority to the services that are deployed on the same node than the consumer, or select one on a remote node. 
The hardware usage criteria (CPU, memory usage) is not implemented for the moment. But it could be one routing strategy.

Once you have chosen a routing strategy (server.properties), the routing uses it. It is transparent. 
However, service consumers can set a different routing strategy on a given message. It depends on the Petals component you use.
Petals supports it, but not all the components allow you to use this feature.

Also, remember that a Petals service is identified by a triplet: the interface name, the service name and the end-point name.
These values are all visible in the jbi.xml of a service provider. In order to use the routing, you must have at least two service providers that match the needs of a consumer. This is why service consumers should invoke a service by using either its interface-name, or it service-name, or both. But if they invoke a service by specifying the entire triplet, they will have, at most, one matching provider. And routing will not be used.

Example:

Suppose you have three services that implement the same interface.

( Service ID: interface name, service name, end-point name )

Service 1-1: SellPortType, Service1, Service1Endpoint1
Service 1-2: SellPortType, Service1, Service1Endpoint2
Service 2: SellPortType, Service2, Service2Endpoint1

Service 1-2 is the same service (same service name) than Service 1-1, but deployed somewhere else.
Now, suppose you have one consumer.

If it consumes SellPortType, then it will find 3 matching services. And thus, a routing strategy will be used.
If it consumes SellPortType + Service1, then it will find 2 matching services. And thus, a routing strategy will be used.
If it consumes SellPortType + Service1 + Service1Endpoint1, then it will find only 1 matching service. And thus, a routing strategy will be useless.

I hope that it will help you. ;)




-------------------- m2f --------------------

Subscribe/Unsubscribe emails notifications :
http://forum.petalslink.com/m2f_usercp.php

Response to this email will be posted on the Petals forum.
Please delete the existing text before responding :)

Read the topic online:
http://forum.petalslink.com/viewtopic.php?p=31751#31751

-------------------- m2f --------------------






More information about the Users mailing list