|
|
|
|||||
|
Session, Replica groups and load balancing
Hi,
Can I have a replicator group within a session? The factory object in the code below is allocated by type. There are several instances of it, and the idea of the loop below is to keep them all busy until the job is done. the Ice runtime returns randomly (according to the manual) an instance that is not locked by the session, but is blocking when all factory objects are in use. By releasing the factory object at the end of the body, one achieves that all factory objects are in use concurrently. (Wouldn't it be natural that the object is released automatically when it is destructed?) Now I want to add load-balancing. From the manual I read that replica-groups are meant for that purpose, but the example given does not involve a session. I have tried several ways, but to no avail. How can I achieve load-balancing in such a situation? Regards, Bertwim ================================================== == for (i=0; i<argc; i++) { Ice::ObjectPrx obj = _session->allocateObjectByType( ::Foo::MyFactory" ); Foo::MyFactoryPrx factory = Foo::MyFactoryPrx::checkedCast( obj ); Foo::MyProdPrx prod = factory->createProd(); prod->doSomething_async(...); // Note: asynchronous! Ice::Identity id = factory->ice_getIdentity(); _session->releaseObject( id ); } |
|
|||||
|
What I meant with my suggestion:
Consider the piece of code is showed earlier (I discovered the quote trick): Quote:
Quote:
On the load-balancing in the allocation system: yes, it would be nice if some clever form of load-balancing would be supported here as well. The usefulness of sessions in real life situations is not fully clear to me. Speaking in general, if you have 1 client but multiple servers, and each server resides behind a firewall (not necessarily the same firewall!, my understanding is that one needs to use a session and work with Glacier2. (and hence live with the "random" load-balancing). I would appreciate your comments. Thanks Bertwim |
|
||||||
|
Quote:
. I recommend you to take a look at this FAQ. As explained by the FAQ, proxies and Ice objects are really two different things. When the proxy object is destroyed (when it goes out of scope), the Ice object pointed by the proxy isn't destroyed (hence the misunderstanding, I thought you were mentioning the Ice object destruction in your first post ).Quote:
Quote:
One use case is the one presented in the Ice manual where you have multiple machines hosting MP3 encoder objects. Clients use the allocation mechanism to allocate MP3 encoders. You could also not use the allocation mechanism but then you could end up with many clients using the same MP3 encoder concurrently (coordinating the clients ensures that not too many clients use the same encoder). Quote:
Perhaps you could describe what you're trying to achieve? This would help to better understand your needs and give you better guidance. Cheers, Benoit. |
|
|||||
|
Benoit,
Thanks for your previous answers. They are clear. On your remark: Quote:
As a limit situation, I now consider the case where there is 1 client and 2 servers, all three running on different machines, and each machine has its own security policy. What do I need to do? If the answer is that a non-Ice solution is to be preferred, that's fine with me. Regards, Bertwim |
|
||||||
|
There are many different solutions to this particular problem. However, without more knowledge of what exactly you are trying to do, your goals, network architecture, restrictions and other such details its impossible to give you good advice on how to architect, manage and deploy Ice in your environment. If you provide more details we'll do our best to help.
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Replica Groups and conections | jae | Help Center | 7 | 04-02-2007 07:02 PM |
| Load Balancing with IceStorm | zhi | Help Center | 8 | 01-09-2007 12:18 PM |
| question about load-balancing | canyoudink | Help Center | 5 | 10-20-2006 06:43 AM |
| About load balancing | ganzuoni | Comments | 3 | 12-07-2005 08:15 AM |
| Load Balancing | ganzuoni | Help Center | 8 | 06-20-2003 07:07 PM |