cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl : Issue with Threads and slower response time

From: Sandeep Kale <sandeep.skale_at_patni.com>
Date: Thu, 4 Sep 2008 11:23:04 +0530

Hi Dan,

Is there any way to reuse the connection or keeping the previous connection
alive? Will connection reuse solve both the issues (OpenSSL contexts and
Response time)?

-San

======================================================
Date: Wed, 3 Sep 2008 10:37:43 -0700
From: Dan Fandrich <dan_at_coneharvesters.com>
Subject: Re: libcurl : Issue with Threads and slower response time
To: curl-library_at_cool.haxx.se
Message-ID: <20080903173741.GC12978_at_coneharvesters.com>
Content-Type: text/plain; charset=us-ascii

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
------------------------------
_______________________________________________
curl-library mailing list
curl-library_at_cool.haxx.se
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-library
End of curl-library Digest, Vol 37, Issue 7
*******************************************
Received on 2008-09-04