curl / Mailing Lists / curl-library / Single Mail


Re: Limit connection reuse to the first 120 seconds

From: Stefan Eissing via curl-library <>
Date: Tue, 16 Apr 2019 09:49:08 +0200

Same behaviour for HTTP/2 connections?

> Am 15.04.2019 um 22:37 schrieb Daniel Stenberg via curl-library <>:
> Hi,
> I propose we change the connection reuse logic in curl to only ever consider connections that have been kept in the connection pool for shorter than 120 seconds. Connections that have been kept around for longer than this will instead get disconnected [1].
> The reason is simply that the longer the connection has been idle, the less likely it is to a) be useful again and b) to actually work to reuse. Avoiding reuse attempts that have a high risk of failing will improve performance and behavior.
> My PR for this change is here[2]. The max age (120 seconds) in this code is currently "hardcoded" but I'm sure there might be use cases for changing it, so I'm open for making it possible to set through the API.
> Comments?
> [1] = they will get disconnected when "found" by one of the algorithms so they may in fact be kept around longer than 120 seconds but they will not be reused if found later.
> [2] =
> --
> /
> -------------------------------------------------------------------
> Unsubscribe:
> Etiquette:

Received on 2019-04-16