In 'SortedFixed' load balancing strategy requests are routed to same host, others are used only in case of failover. Order of hosts to try is determined by instance id.
Note: Order of hosts to try is the same for all instances of LoadBalancedPool.
newInstanceList.Swap(i, randIdx) } case LBSortedFixed: // In SortedFixed strategy, InstanceList is a sorted list, sorted by instanceId. sort.Sort(newInstanceList)
instanceIdx := atomic.AddUint64(&pool.instanceIdx, 1) idx = int(instanceIdx % uint64(len(pool.instanceList))) case LBSortedFixed: // In SortedFixed strategy instances are always traversed in same // exact order.
LBSortedFixed is referenced in 1 repositorygithub.com/dropbox/godropbox
- 2 references in net2/http2/load_balanced_pool.go
LBSortedFixed LBStrategy = 1