About Properties For Connection Cache
There is "name.ConnectionCached" in "Proxy Properties".
Why not supply Ice.Default.ConnectionCached?
ConnectionCached has two effects.
First, whether a proxy bind the connection used by first time invocation.
Second, whether another proxy (point to the same ice object) reuse a existing connection even if they has different endpoint set, endpoints order and selection type.
We can't let a proxy give higher priority to endpoints selection than reuse a existing connection.
Trade off between load balance, invocation serialize, horizontal scale, connection reuse, collocation optimized, and fail-over become difficult and inflexibility because we can't control connection via control endpoints and it's order , especially when Glacier2 and IceStorm are participation.
For example, multi-client call multi-server via multi-Glacier2 and Glacier2 Use IceGrid as Locator.
If we want multi-server load balance and fail-over by system load, the only way i found is config below:
Ice.Default.LocatorCacheTimeout = x, x must >= 0, smaller to more frequently query from locator
Ice.Default.EndpointSelection = Ordered
Ice.Default.Locator.EndpointSelection = Random
Ice.Default.Locator.ConnectionCached = 0
Ice.BackgroundLocatorCacheUpdates = 1 (to avoid invocation delay)
IceGrid Deployment Descriptors - replica group:
y must > 0 and must < num of server, This is the point and the side effect.
If glacier-A has a connection to server-A, Ice establish a new connection only when this new endpoint list from locator don't contains server-A's endpoint. so locator must not return all endpoints.
A side effect is, we can't use per-request load balance in server internal, because locator can't return all endpoints to the ice object. A sulotion is put the servant into two objectAdapter with different identity and different replica group, one for glacier, another for server internal.
Another side effect is Automatic Retries.Since locator return less endpoints, ice retry may be fail even if some server still alive.