Dynamic weighted load balancing for target servers

Not applicable

I want to use weighted load balancing algorithm for target servers.

In my requirement,I want to change the weight of the load balancing dynamically.

If I give as given in apigee docs example,it is constant.

<TargetEndpoint name="default">
  <HTTPTargetConnection>
    <LoadBalancer>
      <Algorithm>Weighted</Algorithm>
      <Server name="target1">
        <Weight>1</Weight>
      </Server>
      <Server name="target2">
        <Weight>2</Weight>
      </Server>
    </LoadBalancer>
    <Path>/test</Path>
  </HTTPTargetConnection>
</TargetEndpoint>
  1. I thought of using KVM ,where I can change the Weight and use it in this proxy.But without using KVM policy in a proxy(with PUT in KVM),how can I change the values in KVM?doesthe change in KVM needs any restart?
  2. Is there any other better way to do this dynamic weight change after some period of time when our service provider requests for new weight in load balancing?

Please suggest

Solved Solved
1 5 302
1 ACCEPTED SOLUTION

HI @RK4

KVM value change does not need restart. It should reflect immediately. You can change it using the Mgmt UI or using this Mgmt API (assuming your org is CPS enabled)

View solution in original post

5 REPLIES 5

HI @RK4

KVM value change does not need restart. It should reflect immediately. You can change it using the Mgmt UI or using this Mgmt API (assuming your org is CPS enabled)

Thanks @Sai Saran Vaidyanathan

Is using KeyValue map only good option for such usecases?or is there any other better way?

Hi @RK4

KVM is good, but looks like Weighted load balancer does not support dynamic values. You will need to put static values as you mentioned in your example above <Weight>1</Weight>.

We will probably open an enhancement request and get the docs updated.

@docs: ^

Ok..Thanks for your update.