Load balance HTTP based on a percentage of traffic


(Andrejs Jermakovics) #1

Hi all,

I was wondering if Caddy already supports this feature:

  • load balance a percentage of all traffic (say 10%) to one of proxy backends.

The use cases are:

  • Canary deployment of a new version of a service.
  • A/B testing

Apparently it’s possible to do this in Nginx using split clients: http://nginx.org/en/docs/http/ngx_http_split_clients_module.html

If it’s not possible at the moment, would it be feasible to implement this as a proxy policy?

Many thanks in advance!


(Matt Holt) #2

I don’t think there’s a native way to do this (yet) but it could be implemented, sure.

One possible hacky way to do it would be to specify the 10% backend once, and the 90% backend 9 times. I mean, that’s obviously weird but it might hold you over until someone implements it! :slight_smile:


(Andrejs Jermakovics) #3

Ha, that is a nice workaround :smile:
Thank you!


(system) #4

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.