-
Notifications
You must be signed in to change notification settings - Fork 229
WIP: Document hash-based routing #569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,47 @@ | ||||||
| --- | ||||||
| title: Hash-Based Routing | ||||||
| owner: CF for VMs Networking | ||||||
| --- | ||||||
|
|
||||||
| ## <a id="purpose"></a> Purpose | ||||||
|
|
||||||
| Hash-Based Routing is a load-balancing algorithm that distributes incoming requests to application instances based on a hash of a specific HTTP header value. This ensures consistent routing behavior where requests containing the same header value are always directed to the same instance. | ||||||
|
|
||||||
| ## <a id="key-features"></a> Key Features | ||||||
|
|
||||||
| - **Configurable via Per-Route Options**: Easily set up Hash-Based Routing using application route options | ||||||
|
||||||
| - **Configurable via Per-Route Options**: Easily set up Hash-Based Routing using application route options | |
| - **Configurable via Per-Route Options**: Easily configurable via per-route options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the same words twice.
WDYT about
Configurable via Per-Route Options: Hash-Based load-balancing setup through application route options
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - **Consistent Hashing**: Implements the Maglev consistent hashing algorithm as outlined in the paper "Maglev: A Fast and Reliable Software Network Load Balancer" (https://storage.googleapis.com/gweb-research2023-media/pubtools/2904.pdf) | |
| - **Consistent Hashing**: Consistent hashing via the Maglev Algorithm (see [Maglev: A Fast and Reliable Software Network Load Balancer](https://storage.googleapis.com/gweb-research2023-media/pubtools/2904.pdf) for details) |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the recalculation is not the expensive part. The really expensive part is the resulting shift of specific hashes to other instances. This rehashing minimization makes sure that happens as little as possible and keeps the "allocation" of hash values to their instances as stable as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right. I did not like the word recalculation either, I wanted to say the same what you mentioned.
Maybe:
**Minimal Rehashing**: Uses the Maglev lookup table to map application instances by hash, ensuring that hash positions are shifted to other instances as little as possible when application instances are added or removed."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds great!
b1tamara marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
b1tamara marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the sticky session counted towards the balance / in-flight requests or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All in-flight requests will be counted (incl. sticky session requests). It happens via {RoundRobin Iterater | HashBased Iterator | LeastConnection Iterator}.PreRequest logic
b1tamara marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
b1tamara marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These paragraphs are very wordy and a bit meandering. LLM?
Either way, the main point is:
Session affinity works on session level. Heavy users may end up on the same instance and through session affinity pin to it, thus overloading it. Identifying sessions for web applications is usually done via session cookie and does not pose too much implementation burden. CF only supports a single cookie name however, defaulting to JSESSIONID.
With hash based routing, identifiers other than the session ID can be used, and spill-over to other instances is possible with the balance factor (see next section).
Uh oh!
There was an error while loading. Please reload this page.