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

Support client-side load balancing with the connection pool #2828

Open
jrudolph opened this issue Nov 26, 2019 · 3 comments
Open

Support client-side load balancing with the connection pool #2828

jrudolph opened this issue Nov 26, 2019 · 3 comments
Labels
1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted help wanted Identifies issues that the core team will likely not have time to work on t:client Issues related to the HTTP Client t:core Issues related to the akka-http-core module t:docs Issues related to the documentation

Comments

@jrudolph
Copy link
Member

How it could work:

  • Allow customization of DNS resolution (see also Client API for manually resolving hostnames to IP addresses #92) which may return multiple addresses per host
  • Allow overriding of target addresses when creating a connection
  • In the pool, use different target addresses per slot
  • Maybe a custom scheduling is also needed so that sequential requests don't all go the same then-idle connection

One way that users could hack in the first parts without changes to akka-http would be to use a custom ClientTransport returning a Flow that would transparently connect to different addresses each time it is materialized.

See also #1226

@jrudolph jrudolph added 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted t:client Issues related to the HTTP Client t:core Issues related to the akka-http-core module labels Nov 26, 2019
@jrudolph jrudolph added this to the 10.2.0 milestone Nov 26, 2019
@raboof raboof self-assigned this Apr 16, 2020
@raboof raboof removed their assignment May 15, 2020
@jrudolph
Copy link
Member Author

jrudolph commented Jul 2, 2020

We already implemented max-connection-lifetime a long while ago to limit how long connections should stay alive until a new one is opened.

When #3202 is merged, you can customize resolution behavior for every new connection. I think that somewhat solves the first three points above:

even though it doesn't given you a turnkey solution yet.

The remaining point would be to add documentation about this and:

  • Maybe a custom scheduling is also needed so that sequential requests don't all go the same then-idle connection

I'm not sure that this is an actual problem because sequential requests are exactly that, sequential and the best way to use the pool is to run them all sequential over the same hot connection. If the sequential requests are only sequential by chance, then too much load on that one host should lead to the connection being less likely to be idle when the next request comes in, so requests should be spread out automatically.

@jrudolph jrudolph added the t:docs Issues related to the documentation label Aug 5, 2020
@jrudolph jrudolph modified the milestones: 10.2.0, 10.2.1 Aug 5, 2020
@jrudolph jrudolph added the help wanted Identifies issues that the core team will likely not have time to work on label Aug 5, 2020
@jrudolph
Copy link
Member Author

jrudolph commented Aug 5, 2020

It seems the essential functionality is there but could be explained better. I'll leave it open for that.

@jrudolph
Copy link
Member Author

jrudolph commented Oct 7, 2020

I created another ticket to discuss whether client-side load-balancing should be its own component. See #3505.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted help wanted Identifies issues that the core team will likely not have time to work on t:client Issues related to the HTTP Client t:core Issues related to the akka-http-core module t:docs Issues related to the documentation
Projects
None yet
Development

No branches or pull requests

2 participants