Keep-alive connection lifetime #2077
-
|
Is there are way to set max lifetime of the keep-alive connection? For example, such setting may be helpful for clien-side loadbalancing in k8s, i.e. if connections got closed and opened again after some time they will end up in connecting to different instances of requested service. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
Example of such setting in akka-http https://doc.akka.io/docs/akka-http/current/common/timeouts.html#connection-lifetime-timeout |
Beta Was this translation helpful? Give feedback.
-
|
I've escalated it into an issue, since it looks like it's not covered in the docs right now. You can control the keep alive expiry like this... limits = httpx.Limits(keepalive_expiry=30.0)
client = httpx.Client(limits=limits)Thanks for the feedback - really great prompt to help us document this. |
Beta Was this translation helpful? Give feedback.
I've escalated it into an issue, since it looks like it's not covered in the docs right now.
See issue #2079 to track this.
You can control the keep alive expiry like this...
Thanks for the feedback - really great prompt to help us document this.