curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

RE: [EXTERNAL] Re:Re: [HELP] What's the underlying connection reusing policy, can it be RR

From: Max Dymond via curl-library <>
Date: Thu, 20 Jan 2022 18:10:46 +0000

> Thanks for your reply,.<br/><br/>Yes, I don't do repeated request. Maybe come a request, then next one come an hour later. But the requests are latency concered(should be less than 50ms) . <br/><br/>If every request comes, then make a new connection to the server, the total cost of the request would probably exceed 50ms due to tcp handshake.<br/><br/>So I hope to keep the underlying connection in libcurl cache to stay as long as possible, such that once a request comes, <br/>there's a 'ready' connection(no need to establish from srcatch) to handle it.

Are you using HTTP/2 or plain HTTP? For HTTP/2 there's which is designed to keep a long-lived connection alive to a server by sending periodic HTTP/2 PING frames.

Otherwise it sounds like you might have to configure the TCP keepalive settings of the host to keep the connection alive for longer; or, write your client in such a way that it periodically sends keepalive requests to the server (perhaps by sending OPTIONS to the server).
Received on 2022-01-20