Open andreytkachenko opened 3 years ago
So far, hyper's Client
has held strictly this admonition in the HTTP/2 RFC:
Clients SHOULD NOT open more than one HTTP/2 connection to a given host and port pair
I realize some users may wish to do so anyways, but doing that requires more code logic to do better. For instance, once a connection has hit the max concurrent streams, and another connection is open, how do you determine which connection should get the new streams? The right answer is probably to use some load balancing.
So far, the suggested alternative has been for people to use hyper::client::conn
in that case, and load balance using tower::balance
.
Thank you for your reply and for good advise. I will try use tower::balance
in my case.
Is your feature request related to a problem? Please describe. I have many concurrent requests most of them going to one domain. Hyper multiplexes them onto one physical connection. This connection has bandwidth limit. I have no ability (except creating new connection for each request) to define a number of maximum parallel connections for domain name.
Describe the solution you'd like add option in
ClientBuilder
to define max_concurrent_requests_per_domain or similar)Describe alternatives you've considered Create new client for each request (limiting only one request per connection) - has higher overhead