cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: HTTPS CURL get slower than HTTP

From: Sagar Hagawne <shagawne_at_apsiva.com>
Date: Thu, 22 Nov 2012 16:19:14 +0530

> >> Betreff: Re: The HTTPS CURL get slower than HTTP CURL
>>
>> On Fri, 16 Nov 2012, Sagar Hagawne wrote:
>>
>>> if i am using the http as a protocol it just grab the values in a few
>>> seconds(3 to 4) but using https its a big issue around 40 sec it takes
>>> when
>>> i am calling curl_easy_perform(curl) why so?
>>
>> HTTPS implies a few extra round-trips and more CPU processing in both
>> ends,
>> but it really shouldn't make any significant difference speedwise.
>>
>> My only explanation is that the server is very very slow. You can
>> investigate
>> the network details with a tool like wireshark to figure out the exact
>> details
>> that go over the wire.
>
> After doing some additional research, here is more information that I
> found out:
>
> 1) The delay issue only occurs the first time that curl_easy_perform()
> is called.
> 2) When tailing my server's Apache ssl_access_log, the call to the
> server didn't even register for 23-25 seconds, after curl_easy_perform()
> was called.
> 3) On all subsequent calls to the exact same curl_easy_perform(), the
> ssl_access_log was immediately updated with a log entry.
> 4) I then tried a different URL ( https://mail.google.com/ ) and the
> exact same things occurred. The first call took 23-25 seconds to get a
> response, while all subsequent calls were instantly returned.
>
> The problem seems to be some sort of initializing issue. We are using
> version of curl 7.27.0.
> To figure out in detail what's happening, use strace and wireshark on the
> client-side to start with to fully see what the time is spent on. That's a
> lot
> better than just assuming or guessing.
> ________________________________________
>
> My Favorite for such a job is the proxy webscarab:
> dawes.za.net/rogan/webscarab

Sir we used Strace tool to measure the Packet Transformed, the Strace log is
as in attached file in mail

we are using InDesign To call the Curl url but at the first time for calling
curl_easy_perform()
 (when i am trying to get the sectionId) it is taking lots of time ( only
at the first timeit is slower, but same url on browser gets fast response)
On all subsequent calls after first call to the exact same
curl_easy_perform(), the response was immediately taken.

we are using some set of initialization code in curl service code before
curl_easy_perform like below

   char error[1024];
  curl_easy_setopt(curl, CURLOPT_VERBOSE, FALSE);
  curl_easy_setopt(curl, CURLOPT_URL, url.GetPlatformString().c_str());
  curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE
5.02; Windows NT 5.0)");
  curl_easy_setopt(curl, CURLOPT_HEADER, FALSE);
  curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
  curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
  curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error);
  curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &AppWriteMemoryCallback);
  curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk1);
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
  res = curl_easy_perform(curl);

Any Idea on this issue we need to figure out, offcourse their is a issue
while calling https curl at first time

Thanks,
Sagar.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2012-11-22