cURL / Mailing Lists / curl-library / Single Mail


Re: can I limit the number of simultaneous transfers with the multi API?

From: Daniel Stenberg <>
Date: Wed, 2 Jun 2010 19:47:02 +0200 (CEST)

On Wed, 2 Jun 2010, Adam Kellas wrote:

> My application uses libcurl (7.20.1) to upload many files to a single
> dedicated server. The multi API is used for speed, and it works great.
> However, I've found that when the number of simultaneous transfers gets too
> large some data is lost at the server end (the test case that generates
> breakage is around 400 parallel transfers). This is very likely NOT a
> libcurl bug, more probably a limitation of the server, but I'd like to try
> addressing it by enhancing our client to allow a limit on parallel transfers
> to be configured.

So how many easy handles do you add to the multi handle? And btw, what OS are
you doing this on?

> I see there is a CURLMOPT_MAXCONNECTS setting but this seems to be a little
> different. Does anyone have example code showing how to limit the number of
> active transfers to 10 or 100 or so?

You control that by not adding more handles than you want to be transfered in
parallell. CURLMOPT_MAXCONNECTS is then used to make sure than no more than
the specified amount is kept open.

List admin:
Received on 2010-06-02