HTTP2 multiple connection pooling #2757
Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
-
It's likely you're hitting some contention in the Trying to add support directly in reqwest (well, hyper-util's legacy pool) to use multiple http2 connections would be quite a bit of work, and I'd rather focus that work on the newer pool implementations. If I was wanting to accomplish what you wanted right now, I'd probably construct the layers of reqwest that I needed manually (like from tower/tower-http), and put the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I am maintainer of a couple of OSS projects and recenty released a py03 package that allows for a "pyrthon fanout" to send requests to a microservice load-balancer.
https://github.com/basetenlabs/truss/tree/main/baseten-performance-client
When upgrading to http2, I noticed that there are two kind of performance degradations when switching from http1 to http2.
Under low concurrency (e.g. 1/2/4/8) the http2 reqwest client performs better.
Under high concurrency (64) the http1 client starts to catch up.
Under high number of requests (1024), with a semaphore of say 128, the client performs worse than e.g. 8x 128. For http1, the client performs exactly identical. I updated the http2_initial_stream_window_size + http2_initial_connection_window_size to 2MB each (payloads are ~2kb, so no bottleneck). I also set the http2_max_frame_size.
The result would be to have some kind of max-concurrency per open tcp connection, and allowing multiple streams, and a pool of connections. e.g. a suitable fix would be to have a pool of 32 clients and queueing a new request to the least use one.
Beta Was this translation helpful? Give feedback.
All reactions