Skip to content

Commit af7f187

Browse files
authored
Adding Simple Weighted RR Balancing (#1)
* Add weighted round-robin load balancing support * Improve retry logic for load balancing: ensure unique backends are tried, * Add max attempts safety limit
1 parent 4d9d203 commit af7f187

File tree

2 files changed

+1661
-1622
lines changed

2 files changed

+1661
-1622
lines changed

examples/proxies.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ services:
3838
strip_path: false
3939
strip_query: false
4040

41+
# Round-robin load balancing with multiple backends weighted by 3:1 ratio
42+
- name: rr_test
43+
backends:
44+
- url: "http://localhost:4040"
45+
strip_path: false
46+
strip_query: false
47+
weight: 3 # 75% of traffic
48+
- url: "http://localhost:4041"
49+
strip_path: false
50+
strip_query: false
51+
weight: 1 # 25% of traffic
52+
4153
# Backend with custom headers
4254
- name: custom_headers
4355
backends:

0 commit comments

Comments
 (0)