62
62
``` yaml [Round-Robin]
63
63
lite :
64
64
routes :
65
- - host : api .example.com
66
- backend : [api1 :25565, api2 :25565, api3 :25565]
67
- strategy : round-robin # Fair rotation: api1 → api2 → api3 → api1 ...
65
+ - host : lobby .example.com
66
+ backend : [lobby1 :25565, lobby2 :25565, lobby3 :25565]
67
+ strategy : round-robin # Fair rotation: lobby1 → lobby2 → lobby3 → lobby1 ...
68
68
` ` `
69
69
70
70
` ` ` yaml [Least-Connections]
@@ -90,37 +90,38 @@ lite:
90
90
- host : lobby.example.com
91
91
backend : [lobby1:25565, lobby2:25565]
92
92
strategy : random
93
-
94
- # Performance-based for game servers
95
- - host : games .example.com
96
- backend : [game1 :25565, game2 :25565, game3 :25565]
93
+
94
+ # Performance-based for game servers
95
+ - host : survival .example.com
96
+ backend : [survival1 :25565, survival2 :25565, survival3 :25565]
97
97
strategy : least-connections
98
-
98
+
99
99
# Latency-optimized for competitive
100
- - host : competitive .example.com
101
- backend : [us:25565, eu:25565, asia:25565]
100
+ - host : pvp .example.com
101
+ backend : [pvp- us:25565, pvp- eu:25565, pvp- asia:25565]
102
102
strategy : lowest-latency
103
103
` ` `
104
104
105
105
::::
106
106
107
- | Strategy | Description | Algorithm |
108
- |----------| -------------| -----------|
109
- | ` random` (default) | Random backend selection | Cryptographically secure random |
110
- | `round-robin` | Sequential cycling | Fair rotation per route |
111
- | `least-connections` | Routes to least-loaded backend | Real-time connection counting |
112
- | `lowest-latency` | Routes to fastest backend | Status ping latency measurement |
107
+ | Strategy | Description | Algorithm |
108
+ | ------------------- | ------------------------------ | ------------------------------- |
109
+ | ` random` (default) | Random backend selection | Cryptographically secure random |
110
+ | `round-robin` | Sequential cycling | Fair rotation per route |
111
+ | `least-connections` | Routes to least-loaded backend | Real-time connection counting |
112
+ | `lowest-latency` | Routes to fastest backend | Status ping latency measurement |
113
113
114
114
:: : tip Performance Notes
115
+
115
116
- **Immediate selection**: All strategies return instantly without health checks
116
- - **Natural failover**: Failed connections automatically retry next backend
117
+ - **Natural failover**: Failed connections automatically retry next backend
117
118
- **Latency measurement**: Uses status ping timing (not dial time) for accuracy
118
119
- **Thread-safe**: Atomic operations for connection counting
119
- :: :
120
+ :: :
120
121
121
122
# ## Behavior Examples
122
123
123
- **Round-Robin**: Connection 1 → server1 , Connection 2 → server2 , Connection 3 → server3 , Connection 4 → server1 ...
124
+ **Round-Robin**: Connection 1 → lobby1 , Connection 2 → lobby2 , Connection 3 → lobby3 , Connection 4 → lobby1 ...
124
125
125
126
**Least-Connections**: Always routes to the backend with the fewest active players
126
127
0 commit comments