cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl : Issue with Threads and slower response time

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 3 Sep 2008 10:37:43 -0700

On Wed, Sep 03, 2008 at 06:09:46PM +0530, Sandeep Kale wrote:
> I am using libcurl (7.18.2) since a month and have developed a module which
> connects to different web servers depending on specified url. This module posts
> all kind of requests ( SOAP / HTTPS ) to the specified url at runtime and works
> as expected.

Note that 7.19.0 has just been released.

> Thread Issue:
>
> I have read that libcurl is thread safe ( unless we do not share curl handles).
> I have ensured that the curl handles are not shared between threads, however
> the module does not work as expected when tested above 5 concurrent threads. I
> get ?SSL connect error? frequently.
>
> What might be causing this ? how can I avoid it?

Have you read
http://curl.haxx.se/libcurl/c/libcurl-tutorial.html#Multi-threading ?
If it's connect failures, it might just be that the server limits https
connections to 5 at a time.

> Response Issue:
>
> I have tested to post few requests through the libcurl module and same number
> of requests through a similar module developed using Rogue Wave libraries.
>
> I get a faster response through the Rogue Wave code i.e within 1.5 ? 2.5
> seconds whereas the module developed in libcurl gives response in 4.5 ? 5 secs
> on an average.
>
> What are the situations where the response time can get hampered in libcurl? Is
> there any specific option to get response faster J.

It might be the lack of caching of OpenSSL contexts that causes extra protocol
overhead. This is TODO item 7.5. But comparing the timing in Wireshark would
enable you to pinpoint the problem.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-09-03