Caddy: A/B testing in Caddy?

Created on 16 Mar 2018  路  2Comments  路  Source: caddyserver/caddy

Hello guys i am currently into a situation where i am trying to do A/B testing and i would like to ask if this is possible somehow in caddy? for example

proxy / {
 policy ip_hash
 to backend:8080 backend:9090
}

somehow what i am looking is to add "weight" so one server could receive 20% of the access and the other 80%

if i were to implement this in nginx this would be possible by adding:

 upstream appServer {
  ip_hash;
  server backend:8080 weight=8;
  server backend:9090;
 }

any thoughts?

question

All 2 comments

One idea might be to put the same backend you want to have higher weight in extra times. Not sure if Caddy will collapse those as being the same though.

It shouldn't collapse them, it appends them to a list, so no de-duplication is being done (I'm pretty sure). For now, that will have to do. (Meaning, specify the backends with more weight multiple times.)

Was this page helpful?
0 / 5 - 0 ratings