A/B Testing using reverse_proxy

Assume that I want to A/B Test two sites. One site is hosted at HOST1, and the other, HOST2

If I do reverse_proxy HOST1 HOST2, where I ensure HOST1 and HOST2 are (almost) mutually exclusive in service - ie, they arn’t online/available at the same time, will user traffic be ever disrupted?

I say “almost” because, the service at HOST1 has the ability to know it will be decomissioned soon (I will send it a message before doing the switch) and will stop accepting new connections even if caddy attemps to forward it while continng to service existing requests

  1. If this makes sense, and HOST1 HOST2 are HTTP servers, what status code should they send so that caddy not longer routes traffic to them?
  2. Should I be solving this problem in a different way - like using a different LB algo or writing a custom reverse_proxy implmentation or similar?

Up to you. Use passive health checks and the unhealthy_status option. But HTTP status code 503 Service Unavailable is likely the right thing to use for that.

You haven’t said what your “current way” is, so I’m not sure what a “different way” could be.

Please fill out the help topic template, it’s important to get the full context for the question.


Curious if these can be solutions to the OP:

Will cook up a POC so francislavoie can review.

Well, we don’t really know what they’re asking. We need clarification first. Hence why I asked that they fill out the help topic template, to avoid any confusion, and so we don’t waste our time making assumptions.

1 Like

Fair. I will create a new thread that has to do with LB

This topic was automatically closed after 30 days. New replies are no longer allowed.