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: Thu, 4 Sep 2008 11:12:07 -0700

On Thu, Sep 04, 2008 at 10:43:26PM +0530, Sandeep Kale wrote:
> These are the stats measured using getinfo.
>
> curl_easy_perform()
> |
> |--NAMELOOKUP : 0.0028
> |--|--CONNECT : 0.0679
> |--|--|--APPCONNECT : N/A (not using 7.19.0)
> |--|--|--|--PRETRANSFER : 0.4945
> |--|--|--|--|--STARTTRANSFER : 0.5810
> |--|--|--|--|--|--TOTAL : 3.2329
> |--|--|--|--|--|--REDIRECT : 0.0000

Connection reuse is naturally not going to help on a single connection.

> I have set CURLOPT_FRESH_CONNECT and CURLOPT_FORBID_REUSE to 0 for enabling
> connection reuse.
> curl_easy_setopt(pcurl, CURLOPT_FRESH_CONNECT, 0);
> curl_easy_setopt(pcurl, CURLOPT_FORBID_REUSE ,0);
>
> Is there any other method to enable connection reuse?

That should be enough in most cases, if the server supports it.

> Can we also get the time taken to complete the request and time taken to
> receive the response?

You'll have to check the manual. Try enabling debug output to see if curl
is reusing a connection for subsequent requests.

>>> Dan

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