Open the-mikedavis opened 2 years ago
Found this stress-testing in this PR: https://github.com/sneako/finch/pull/158#issuecomment-986310868
@sneako I really need this feature. Is there any progress on it? Or can I check open_request_count by myself with Finch? Or can I limit the max concurrent request manually?
I checked the :max_concurrent_streams
with the code below.
{:ok, conn} = Mint.HTTP2.connect(:https, "api.openai.com", 443)
Mint.HTTP2.get_server_setting(conn, :max_concurrent_streams)
I'm not aware of any ongoing work on this feature at the moment. PRs are welcome!
When under very high load with many concurrent requests, some requests may fail with
From the
Mint.HTTP2.request/5
docs:It looks like this check is very cheap on the Mint side: it needs to check against a field in the
conn
. See https://github.com/elixir-mint/mint/blob/367230ff0565df69125f93204fcb496774bf69a9/lib/mint/http2.ex#L1065-L1070. There's alsoMint.HTTP2.open_request_count/1
for checking the currently open number of requests for aconn
.I think it'd be ideal that if a
Finch.HTTP2.Pool
process has maxed out its allowed concurrent streams, the request gets redirected to another availableFinch.HTTP2.Pool
process if there is one.I'd be willing to give this a look when I have the time :+1: