trafficserver icon indicating copy to clipboard operation
trafficserver copied to clipboard

How to load balance multiple backends

Open paladox opened this issue 9 months ago • 2 comments

We don't use the dns to load balance backends due to cache and it being ineffective. We've been using varnish and looking at doing a varnish frontend & ats backend setup. We want to get it so request to *.example.org goes to multiple backends using round-robin. Does anyone know how to do that?

e.g. in varnish:

	new mediawiki = directors.random();
	mediawiki.add_backend(mw151, 100);
	mediawiki.add_backend(mw152, 100);
```.

We're going to be using varnish to cache in the ram and then hash the url and then call out to a ats backend.

paladox avatar Mar 22 '25 17:03 paladox

In a pure ATS front and back, the front side would use strategies.yaml, either with the round robin (from the beginning part of the description) or consistent hash policy (from the later part of the description (and better for caching)). (and the front machine could use storage.config or hosting.cofig to assign a RAM disk for its caching)

mlibbey avatar Mar 24 '25 19:03 mlibbey

strategies.yaml also supports a peering mode with consistent hash. On the frontend you could create a peer group, aka cluster, that would share the the peer groups cache among each of the peer group members on the frontend. Just thought I'd mention peering in the event it might be useful to you.

jrushford avatar Mar 24 '25 19:03 jrushford