Skip to content

ClusterLoadAssignment load_balancing_weight with locality seems to behave differently than documentation #6458

@howardjohn

Description

@howardjohn

The ClusterLoadAssignment documentation suggests the weights of the locality and endpoint are multiplied together to get the effective weight.

// granularity between the hosts within a locality. For a given cluster, the
// effective weight of a host is its load_balancing_weight multiplied by the
// load_balancing_weight of its Locality.

In my tests, this doesn't seem to be the case. Here is my config:

      "common_lb_config": {
       "locality_weighted_lb_config": {}
      },
      "load_assignment": {
       "cluster_name": "outbound|80||google.com",
       "endpoints": [
        {
         "locality": {
          "region": "us-central3",
          "zone": "us-central1-a"
         },
         "lb_endpoints": [
          {
           "endpoint": {
            "address": {
             "socket_address": {
              "address": "identity-a",
              "port_value": 80
             }
            }
           },
           "load_balancing_weight": 1
          },
          {
           "endpoint": {
            "address": {
             "socket_address": {
              "address": "identity-b",
              "port_value": 80
             }
            }
           },
           "load_balancing_weight": 1
          }
         ],
         "load_balancing_weight": 2
        },
        {
         "locality": {
          "region": "us-central2",
          "zone": "us-central1-a"
         },
         "lb_endpoints": [
          {
           "endpoint": {
            "address": {
             "socket_address": {
              "address": "identity-c",
              "port_value": 80
             }
            }
           },
           "load_balancing_weight": 1
          }
         ],
         "load_balancing_weight": 1
        }
       ]
      }

Based on this, I would expect:
identity-a gets a weight of 2, so 40% of traffic
identity-b gets a weight of 2, so 40% of traffic
identity-c gets a weight of 1, so 20% of traffic

I am actually seeing an even 33/33/33% split though.

Is this a documentation issue or is something going wrong?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions