You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[x ] I have searched to see if a similar issue already exists.
Is your feature request related to a problem? Please describe.
Calling predict() of simple task but iterating on a large number of inputs generates large number of TIME_WAIT connections.
Describe the solution you'd like
Have an option for predict() to maintain a single httpx session, or takes a httpx client instance from parameter.
Additional context
In some public cloud infrastructure, outgoing connection to public internet is done through shared NATed gateway and the number of unique connections are very limited. TIME_WAIT in Linux takes 30s to clear. When reaching limit, predict() hung as new connection waits for released TIME_WAIT connections.
The text was updated successfully, but these errors were encountered:
Hi @dodysw3 , your changes make sense. If you open a PR one of us can review soon. One comment though is that I would not enable http2 connection by default as that adds a new requirement to the gradio client and the http/2 implementation in httpx is not as mature as http/1.
Instead I think we can first try to instantiate a client with http2 support, if that raises an import error, enable the default http/1 client.
Is your feature request related to a problem? Please describe.
Calling predict() of simple task but iterating on a large number of inputs generates large number of TIME_WAIT connections.
Describe the solution you'd like
Have an option for predict() to maintain a single httpx session, or takes a httpx client instance from parameter.
Additional context
In some public cloud infrastructure, outgoing connection to public internet is done through shared NATed gateway and the number of unique connections are very limited. TIME_WAIT in Linux takes 30s to clear. When reaching limit, predict() hung as new connection waits for released TIME_WAIT connections.
The text was updated successfully, but these errors were encountered: