fly-replay for every other instance?

Another solution for this problem could be to use https://goreplay.org/ Goreplay is mainly used for shadowing and traffic mirroring in real world testing scenario’s but is very flexible.

You can for example use it to filter traffic and forward it to different hosts. Example:

# only forward requests being sent to the /api endpoint to a.com and b.com
gor --input-raw :8080 --http-allow-url /api --output-http "http://a.com"  --output-http "http://b.com"

See:

Goreplay also supports a distributed setup by running it an aggregator. You could for example setup a single app instance that aggregates and forwards the requests to all instances.

If your request is not idempotent letting the aggregator send it to all instances including the instance that received it could makes things even. easier. That way you do not need to make any decisions, all you do is forward.

See: Distributed configuration · buger/goreplay Wiki · GitHub

@kurt totally enjoyed this blog post btw, Globally Distributed Postgres · Fly can we have a fly.io shirt with “When Your Only Tool Is A Front-End Proxy, Every Problem Looks Like An HTTP Header” Please?

2 Likes