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
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Max Dymond via curl-library <curl-library_at_lists.haxx.se>
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 https://curl.se/libcurl/c/curl_easy_upkeep.html 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).
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 https://curl.se/libcurl/c/curl_easy_upkeep.html 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).
-- Unsubscribe: https://lists.haxx.se/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2022-01-20