Skip to content
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

Hash load balancer #381

Merged
merged 2 commits into from
Sep 7, 2021
Merged

Conversation

gilesheron
Copy link
Contributor

First cut of a hashed load-balancer for Quilkin so all requests from one session go to the same endpoint.

Note that hashes by source IP/port. Might be good to make it configurable.

Also doesn't implement a consistent hash (so if the set of endpoints changes all flows will re-hash).

@google-cla
Copy link

google-cla bot commented Aug 27, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Aug 27, 2021
@markmandel
Copy link
Member

Looks like your commits are using gilesheron@users.noreply.github.com right now, which hasn't signed the CLA.

If you rebase down to a single commit, and make sure to use your work email, we should be good to go 🤞🏻

Copy link
Collaborator

@XAMPPRocky XAMPPRocky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR! This looks good to me, pretty nice solution. You mention it would be nice to add configuration, what would you want to configure about the hashing?

@gilesheron
Copy link
Contributor Author

Thank you for your PR! This looks good to me, pretty nice solution. You mention it would be nice to add configuration, what would you want to configure about the hashing?

might be worth having an option to hash by source IP only if you want a mode where all sessions from a given user are routed to the same endpoint?

will re-submit as a single commit with the correct email address - once I work out how to do that!

@quilkin-bot
Copy link
Collaborator

Build Failed 😭

Build Id: c237ffad-373d-4a90-90d7-52dedefe1dce

Status: FAILURE

To get permission to view the Cloud Build view, join the quilkin-discuss Google Group.

1 similar comment
@quilkin-bot
Copy link
Collaborator

Build Failed 😭

Build Id: c237ffad-373d-4a90-90d7-52dedefe1dce

Status: FAILURE

To get permission to view the Cloud Build view, join the quilkin-discuss Google Group.

@XAMPPRocky
Copy link
Collaborator

might be worth having an option to hash by source IP only if you want a mode where all sessions from a given user are routed to the same endpoint?

I might be missing something, but isn't that what setting HASH would do? Or are you suggesting having another option that remembers (ip, port) but doesn't hash?

@gilesheron
Copy link
Contributor Author

might be worth having an option to hash by source IP only if you want a mode where all sessions from a given user are routed to the same endpoint?

I might be missing something, but isn't that what setting HASH would do? Or are you suggesting having another option that remembers (ip, port) but doesn't hash?

ah sorry. Didn't explain myself well.

the current solution hashes on the source SocketAddr. So all traffic from the same IP/port will go to the same endpoint. My guess is that for most games that will ensure that all of a given user's traffic will go to the same endpoint, whilst also giving optimal hashing if e.g. multiple users are behind a NAT, and ensuring that a user can reconnect and get a different endpoint if one endpoint has an issue.

the other approach would be to hash on source IpAddr. that way all traffic from given IP will go to one endpoint. So if a game has multiple flows per user that will ensure that they land on the same endpoint.

@google-cla
Copy link

google-cla bot commented Aug 30, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@quilkin-bot
Copy link
Collaborator

Build Failed 😭

Build Id: 99a55882-9bd7-4bd1-8214-f2c84aed316d

Status: FAILURE

To get permission to view the Cloud Build view, join the quilkin-discuss Google Group.

@google-cla
Copy link

google-cla bot commented Aug 30, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link

google-cla bot commented Aug 30, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@quilkin-bot
Copy link
Collaborator

Build Failed 😭

Build Id: 241eb6ec-7ed0-471f-ba03-96d02a50fdda

Status: FAILURE

To get permission to view the Cloud Build view, join the quilkin-discuss Google Group.

@quilkin-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 72940302-5709-4ea3-8fc1-5909d057d0ca

To build this version:

git fetch git@github.com:googleforgames/quilkin.git pull/381/head:pr_381 && git checkout pr_381
cargo build

Copy link
Collaborator

@iffyio iffyio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@markmandel
Copy link
Member

We were tracking this on Discord, but @thisisnotapril is looking into what the situation is with the CLA.

@markmandel markmandel self-requested a review as a code owner September 3, 2021 18:51
@google-cla
Copy link

google-cla bot commented Sep 3, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@quilkin-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 4f900e4d-9246-41e4-9b11-76cc79b3ebb2

To build this version:

git fetch git@github.com:googleforgames/quilkin.git pull/381/head:pr_381 && git checkout pr_381
cargo build

@markmandel
Copy link
Member

Manual approval on the CLA - so merging 👍🏻

@markmandel markmandel merged commit debca35 into googleforgames:main Sep 7, 2021
@markmandel markmandel added area/user-experience Pertaining to developers trying to use Quilkin, e.g. cli interface, configuration, etc kind/feature New feature or request labels Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/user-experience Pertaining to developers trying to use Quilkin, e.g. cli interface, configuration, etc cla: yes kind/feature New feature or request size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants