Ver código fonte

Merge pull request #2453 from jdrahos/ipvs_weighted_scheduling_constants-2452

weighted scheduling methods constants for ipvs
elangovan sivanandam 5 anos atrás
pai
commit
33e9208a19
2 arquivos alterados com 13 adições e 0 exclusões
  1. 11 0
      libnetwork/ipvs/constants.go
  2. 2 0
      libnetwork/ipvs/ipvs_test.go

+ 11 - 0
libnetwork/ipvs/constants.go

@@ -144,6 +144,17 @@ const (
 	// a statically assigned hash table by their source IP
 	// a statically assigned hash table by their source IP
 	// addresses.
 	// addresses.
 	SourceHashing = "sh"
 	SourceHashing = "sh"
+
+	// WeightedRoundRobin assigns jobs to real servers proportionally
+	// to there real servers' weight. Servers with higher weights
+	// receive new jobs first and get more jobs than servers
+	// with lower weights. Servers with equal weights get
+	// an equal distribution of new jobs
+	WeightedRoundRobin = "wrr"
+
+	// WeightedLeastConnection assigns more jobs to servers
+	// with fewer jobs and relative to the real servers' weight
+	WeightedLeastConnection = "wlc"
 )
 )
 
 
 const (
 const (

+ 2 - 0
libnetwork/ipvs/ipvs_test.go

@@ -21,6 +21,8 @@ var (
 		LeastConnection,
 		LeastConnection,
 		DestinationHashing,
 		DestinationHashing,
 		SourceHashing,
 		SourceHashing,
+		WeightedLeastConnection,
+		WeightedRoundRobin,
 	}
 	}
 
 
 	protocols = []string{
 	protocols = []string{