Load Balacing

Janus provides multiple ways of load balancing requests to multiple backend services: a roundrobin (or just rr) method, and a weight method.

Round Robin

{
    "name": "My API",
    "proxy": {
        "listen_path": "/foo/*",
        "upstreams" : {
            "balancing": "rr",
            "targets": [
                {"target": "http://my-api1.com"},
                {"target": "http://my-api2.com"},
                {"target": "http://my-api3.com"}
            ]
        },
        "methods": ["GET"]
    }
}

This configuration will apply the roundrobin algorithm and balance the requests to your upstreams.

Weight

This configuration will apply the weight algorithm and balance the requests to your upstreams.

Last updated

Was this helpful?