cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: how to limit maximum sockets libcurl uses

From: Vladimir Grishchenko <vladgri_at_hotmail.com>
Date: Fri, 16 Sep 2011 11:16:23 -0700

Our solution to this was to implement a request queue outside of libcurl
that limits handle usage to some predefined number - if we know we used up
all allowed handles the request is put on the queue, the first pending one
is taken from the queue once a handle comes back.

-V.

--------------------------------------------------
From: "Daniel Stenberg" <daniel_at_haxx.se>
Sent: Friday, September 16, 2011 6:45 AM
To: "libcurl development" <curl-library_at_cool.haxx.se>
Subject: RE: how to limit maximum sockets libcurl uses

> On Fri, 16 Sep 2011, Yamin Zhou wrote:
>
>> this means that we have no way to limit how many sockets libcurl opens
>> and tries to connect?
>
> I don't understand what made you draw that conclusion. If you don't add
> more handles, it won't use more connections.
>
>> we have a problem here that libcurl tries to do 1000 connections per
>> second when server is down, and this causes a big burden to the gateway
>> of our system.
>
> So stop adding new handles at that pace if that's a problem for you!
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-16