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

Add API for configuring minimum connections for HTTP/2 connection pool #2155

Closed
wants to merge 1 commit into from

Conversation

violetagg
Copy link
Member

Fixes #1808

Copy link

@crankydillo crankydillo left a comment

Choose a reason for hiding this comment

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

I understand a decent bit, and it looks good to me. Have a question about the doc though.

@@ -80,6 +80,10 @@
* <li>{@link PoolMetrics#idleSize()} always returns {@code 0}.</li>
* </ul>
* <p>
* If minimum connections is specified, the cached connections with active streams will be kept at that minimum
* (can be the best effort). However, if the cached connections have reached max concurrent streams,
* then new connections will be allocated up to the maximum connections limit.
Copy link

@crankydillo crankydillo Apr 22, 2022

Choose a reason for hiding this comment

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

Hmm, so the code now will do this, right:
For any new HTTP/2 request, if the number of socket connections is below the minimum number of connections, a new socket connection will get created and the HTTP/2 stream will get created on that new socket connection, right?

I don't really get that from the javadoc, but that may just be me.

What does the best effort part mean? I think I'm missing that part in the code and want to make sure I'm not misunderstanding something?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, so the code now will do this, right: For any new HTTP/2 request, if the number of socket connections is below the minimum number of connections, a new socket connection will get created and the HTTP/2 stream will get created on that new socket connection, right?

yes

I don't really get that from the javadoc, but that may just be me.

What does the best effort part mean? I think I'm missing that part in the code and want to make sure I'm not misunderstanding something?

As we do not have a strong synchronisation between when we return the connection and we acquire the connection we may not be able to stay exactly on the min number that is specified.

@violetagg violetagg modified the milestones: 1.0.19, 1.0.20 May 3, 2022
@violetagg
Copy link
Member Author

I need to think about the proper place for this configuration. Most probably on the level of ConnectionProvider as we can have connection pools per remote host.

@samueldlightfoot
Copy link
Contributor

samueldlightfoot commented May 16, 2022

Thanks for this - we are very keen to consume this feature to aid our balancing too!

@violetagg violetagg added the status/superseded An issue that has been superseded by another label Jun 6, 2022
@violetagg violetagg removed this from the 1.0.20 milestone Jun 6, 2022
@violetagg
Copy link
Member Author

This is superseded by #2257

A new API Http2AllocationStrategy is exposed so that minimum connections and maximum concurrent streams can be configured.

@violetagg violetagg closed this Jun 6, 2022
@violetagg violetagg deleted the issue-1808 branch June 9, 2022 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/superseded An issue that has been superseded by another type/enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTTP2 - Round-robining streams across a minimum setting of connections
3 participants