Home Help Center

IceGrid Replication and load balancing per function invocation

spsonispsoni Member Sury P SoniOrganization: Next DigitalProject: Unified Messaging Plattform for Inhouse Products ✭✭
Hi,

I am curious, if is there any mechanism in Ice products to get load balancing per function invocation rather than per connection using IceGrid replication.

I am working on distributing data on different nodes in round robin fashion. Currently, I am using IceGrid.Query.findAllReplicas function to get all replicated adapter proxies and doing my own round robin thing, but is there any inbuilt thing available.

I also tried doing this by calling shutdown on server after finishing every function invocation, so that client will query icegrid again for next proxy, but this slowed down performance a lot. So, I switched to above technique of using findAllReplicas. But I want to make replicas transparent to client, so is there any better way of doing this?

Thanks.

Surya

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    Yes, you can configure the proxy in your client to not re-use the same connection for all invocations on the proxy and to consult the IceGrid locator for each invocation to figure out which replica to use, for example:
       proxy = proxy->ice_connectionCached(false)->ice_locatorCacheTimeout(0);
    

    Check the documentation of the ice_connectionCached, ice_locatorCacheTimeout and ice_endpointSelection proxy methods in the Ice manual for more information. I also recommend checking out Matthew's newsletter article on Ice connection management.

    Let us know if you need more information.

    Cheers,
    Benoit.
Sign In or Register to comment.