Replies: 1 comment 1 reply
-
The cost is used as a threshold for choosing one path over another. Using your example, Cluster-3 will look at its paths to Clusters 1 and 2. For a given service running on Clusters 1 and 2, it will add the number of open connections to the cost for each path. The balancing algorithm will then attempt to equalize those sums as new connections are opened. So if the link to Cluster-1 has cost 1 and the link to Cluster-2 has cost 1000 and there are zero open connections, Cluster-3 will see sums of 1 and 1000 respectively and direct new connections to Cluster-1. Once there are 1000 open connections to Cluster-1, the sums will be 1001 and 1000 and the next connection will be forwarded to Cluster-2. Subsequent connections will then alternate to keep the numbers equal. If the service instance on Cluster-1 goes away, that path will no longer be considered and the relatively large cost to Cluster-2 will not have any effect on routing. To create an "active/standby" effect, set the cost of the path to the standby cluster to a number that is larger than the expected maximum number of concurrently open connections. Alternatively, if there is an open connection count that represents "overload", use that as the cost to allow spillover in the event of overload. |
Beta Was this translation helpful? Give feedback.
-
Hi - I am looking to set up a scenario where I have two deployments I want to expose running on separate Openshift clusters. In an active/standby mode I want a 3rd cluster to prefer Cluster1 almost all the time and only go over to Cluster2 if there are problems with cluster 1 or it is overloaded.
Is this possible with setting the link cost when I hook up Cluster 3 to Cluster 1 and 2 - I thought it might but I don't see a detailed breakdown of what the cost means in a practical example. Do I need to set Cluster 1 cost =1 and Cluster 2 cost to an arbitrarily large number to achieve this?
There is this paragraph which then mentions connection thresholds and I wasn't sure where this threshold comes from either.
"When there are a number of paths from a client to server instances or a service, traffic flows on the lowest cost path until the number of connections exceeds the cost of an alternative path. After this threshold of open connections is reached, new connections are spread across the alternative path and the lowest cost path."
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions