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

Should connections start with a randomly chosen host? #109

Closed
djMax opened this issue Oct 2, 2017 · 2 comments
Closed

Should connections start with a randomly chosen host? #109

djMax opened this issue Oct 2, 2017 · 2 comments
Assignees

Comments

@djMax
Copy link

djMax commented Oct 2, 2017

We noticed in our cluster that the first rabbit host was receiving almost all the traffic. I assume this is because rabbot always connects to the first host first. Should it start at a random point in the list?

@arobson
Copy link
Owner

arobson commented Feb 17, 2018

@djMax - yeah - I guess ideally it would maybe hash on pid so that even if you ran multiple processes on a single box they'd spread connections? Let me see if I can work something out quickly and add it to the current release I'm trying to get out later this weekend.

@arobson
Copy link
Owner

arobson commented Feb 17, 2018

@djMax - ok, this was really simple - I just used an approach that modulos pid unless it's 1 or less (docker containers make your process pid 0 or 1 I think) and then if the pid is that low, it hashes the hostname to an int and modulos that instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants