Keep-alive connection lifetime #2077
Answered
by
lovelydinosaur
lazitski-aliaksei
asked this question in
Q&A
|
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. |
Answered by
lovelydinosaur
Feb 10, 2022
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 |
0 replies
|
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. |
4 replies
Answer selected by
lazitski-aliaksei
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've escalated it into an issue, since it looks like it's not covered in the docs right now.
See issue https://github.com/encode/httpx/issues/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.