Skip to content

Commit e1b27d0

Browse files
committed
roachprod: load balancing mode
Previously, the load balancer was set to use utilization, but for most testing purposes we want this to be round-robin. This change updates the load balancer to use a max connections setting per instance group which essentially causes the load balancer to use round-robin amongst each group. Epic: None Release note: None
1 parent 8b1e1a9 commit e1b27d0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/roachprod/vm/gce/gcloud.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2323,13 +2323,16 @@ func (p *Provider) CreateLoadBalancer(l *logger.Logger, vms vm.List, port int) e
23232323
spinner := ui.NewDefaultCountingSpinner(l, "adding backends to load balancer", len(groups))
23242324
defer spinner.Start()()
23252325
for n, group := range groups {
2326+
// We use balancing mode CONNECTION and set an "unlimited" number of max
2327+
// connections per group to force the load-balancer to run in round-robin
2328+
// mode.
23262329
args = []string{"compute", "backend-services", "add-backend", loadBalancerName,
23272330
"--project", project,
23282331
"--global",
23292332
"--instance-group", group.Name,
23302333
"--instance-group-zone", group.Zone,
2331-
"--balancing-mode", "UTILIZATION",
2332-
"--max-utilization", "0.8",
2334+
"--balancing-mode", "CONNECTION",
2335+
"--max-connections", "9999999",
23332336
}
23342337
cmd := exec.Command("gcloud", args...)
23352338
output, err = cmd.CombinedOutput()

0 commit comments

Comments
 (0)