cURL / Mailing Lists / curl-library / Single Mail


Re: libcurl 7.18.2: Question on CURLMOPT_MAXCONNECTS

From: Stefan Krause <>
Date: Sat, 28 Jun 2008 14:54:35 +0200

Daniel Stenberg wrote:

>> What happens in case I set the CURLMOPT_MAXCONNECTS to 10 and then
>> add 20 easy handles ? Are the 20 easy handles processed properly ?
> Yes, it'll just limit the number of connections it'll pool so when you
> close one of those 20 connections it won't keep it around since it
> isn't "allowed". That will of course hamper performance on repeated
> requests that would otherwise have been persistent. You should really
> always allow more connections than number of easy handles you have
> added simultaneously.
Now things become clearer. I conclude what I have understand: A
"connection" is an established socket connection (persistent
connection) which may be re-used. libCurl opens as many connections as
it needs for processing all easy handles added at a certain time. After
an easy handles finishes, its connection is closed if the connection
cache limit CURLMOPT_MAXCONNECTS is reached. Otherwise that connection
is added to the cache and is re-used when possible. Is that correct ?
Received on 2008-06-28