github.com/hellofresh/janus@v0.0.0-20230925145208-ce8de8183c67/docs/proxy/load_balacing.md (about) 1 ### Load Balancing 2 3 Janus provides multiple ways of load balancing requests to multiple backend services: a `roundrobin` (or just `rr`) method, 4 and a `weight` method. 5 6 #### Round Robin 7 8 ```json 9 { 10 "name": "My API", 11 "proxy": { 12 "listen_path": "/foo/*", 13 "upstreams" : { 14 "balancing": "rr", 15 "targets": [ 16 {"target": "http://my-api1.com"}, 17 {"target": "http://my-api2.com"}, 18 {"target": "http://my-api3.com"} 19 ] 20 }, 21 "methods": ["GET"] 22 } 23 } 24 ``` 25 26 This configuration will apply the `roundrobin` algorithm and balance the requests to your upstreams. 27 28 #### Weight 29 30 ```json 31 { 32 "name": "My API", 33 "proxy": { 34 "listen_path": "/foo/*", 35 "upstreams" : { 36 "balancing": "weight", 37 "targets": [ 38 {"target": "http://my-api1.com", "weight": 30}, 39 {"target": "http://my-api2.com", "weight": 10}, 40 {"target": "http://my-api3.com", "weight": 60} 41 ] 42 }, 43 "methods": ["GET"] 44 } 45 } 46 ``` 47 48 This configuration will apply the `weight` algorithm and balance the requests to your upstreams.