@@ -66,8 +66,8 @@ offered as a global setting.
66
66
67
67
Rehashing should be minimized, especially when the number of application instances changes over time.
68
68
69
- For the scenario where a new application instance (e.g. app_instance3) is deployed , Gorouter updates the mapping so that
70
- it maps part of the hashes to the new instance.
69
+ For the scenario when a new application instance (e.g. app_instance3) is added , Gorouter updates the mapping so that it
70
+ maps part of the hashes to the new instance.
71
71
72
72
| Hash | Application instance(s) before | Application instance(s) after a new instance added |
73
73
| -------| --------------------------------| ----------------------------------------------------|
@@ -77,8 +77,8 @@ it maps part of the hashes to the new instance.
77
77
| ... | ... | ... |
78
78
| HashN | app_instance2 | app_instance3 |
79
79
80
- For the scenario that the application has been scaled down, Gorouter updates the mapping immediately after routes
81
- update, so that it remaps hashes associated with the app_instance3:
80
+ For the scenario when the application is scaled down, Gorouter updates the mapping immediately after routes update, so
81
+ that it remaps hashes associated with the app_instance3:
82
82
83
83
| Hash | Application instance(s) before | Application instance(s) after the app_instance_3 removed |
84
84
| -------| --------------------------------| ----------------------------------------------------------|
@@ -91,18 +91,18 @@ update, so that it remaps hashes associated with the app_instance3:
91
91
92
92
#### Considering a balance factor
93
93
94
- Before routing a request, the current load on each application instance must be evaluated using a balance factor. The
95
- number of in-flight requests measures this load . For example, with a balance factor of 150, no application instance
94
+ Before routing a request, the current load on each application instance must be evaluated using a balance factor. This
95
+ load is measured by the number of in-flight requests. For example, with a balance factor of 150, no application instance
96
96
should exceed 150% of the average number of in-flight requests across all application instances. Consequently, requests
97
97
must be distributed to different application instances that are not overloaded.
98
98
99
99
Example:
100
100
101
- | Application instance | Current request count | Request count / average number of in-flight requests |
102
- | ----------------------| -----------------------| ------------------------------------------------------|
103
- | app_instance1 | 10 | 20% |
104
- | app_instance2 | 50 | 100% |
105
- | app_instance3 | 90 | 180% |
101
+ | Application instance | Current request count | Current request count / Average number of in-flight requests |
102
+ | ----------------------| -----------------------| -------------------------------------------------------------- |
103
+ | app_instance1 | 10 | 20% |
104
+ | app_instance2 | 50 | 100% |
105
+ | app_instance3 | 90 | 180% |
106
106
107
107
Based on the average number of 50 requests, the current request count to app_instance3 exceeds the balance factor. As a
108
108
result, new requests to app_instance3 must be distributed to different application instances.
@@ -120,14 +120,14 @@ A possible presentation of deterministic handling can be a ring like:
120
120
121
121
#### Gorouter
122
122
123
- - The Gorouter MUST be extended to take a specific identifier via the request header
124
- - The Gorouter MUST implement hash calculation, based on the provided header
125
- - The Gorouter SHOULD store the mapping between computed hash values and application instances locally to avoid
123
+ - Gorouter MUST be extended to take a specific identifier via the request header
124
+ - Gorouter MUST implement hash calculation, based on the provided header
125
+ - Gorouter SHOULD store the mapping between computed hash values and application instances locally to avoid
126
126
expensive recalculations for each incoming request
127
127
- Gorouters SHOULD NOT implement a distributed shared cache
128
- - The Gorouter MUST assess the current number of in-flight requests across all application instances mapped to a
128
+ - Gorouter MUST assess the current number of in-flight requests across all application instances mapped to a
129
129
particular route to consider overload situations
130
- - The Gorouter MUST update its local hash table following the registration or deregistration of an endpoint, ensuring
130
+ - Gorouter MUST update its local hash table following the registration or deregistration of an endpoint, ensuring
131
131
minimal rehashing
132
132
133
133
For a detailed understanding of the workflows on Gorouter's side, please refer to the [ activity diagrams] ( #diagrams ) .
0 commit comments