curl-library
Re: Easy Handle threaded or MultiHandle
Date: Fri, 19 Aug 2011 14:47:23 +0200 (CEST)
On Thu, 18 Aug 2011, Vivek Sekhar wrote:
> 1) Which of the solution will be more optimized if we have to make many
> network calls at a given time.We would like to handle as many requests as
> quickly as possible.
>
> a) Using Easy handle and a thread for every easy handle created.
> b) Using a Multi handle in a single thread.
There's also an option C:
c) Use multiple threads and one multi handle in each
We don't have any numbers or tests. I'm not even sure it is possible to make
any objective comparisons against the different concepts. Use whatever you
think matches your program design best or run tests on your own.
> 2) When using Multihandle in a single thread if large amount of easy handles
> are added(high active jobs) the downloads are slower when compared to
> throttling the jobs(i.e having a limit of job added to a multi handle).
Is that a question? Sure, if you saturate your network bandwidth then you'll
get slower downloads. I doubt you'll see much of a slowdown due to many
simultaneous transfers using the multi interace otherwise. If you go above say
a hundred or several hundred simultaneous transfers you really need to
consider the multi_socket API to achieve the best possible performance.
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2011-08-19