cURL / Mailing Lists / curl-library / Single Mail

curl-library

HTTP requests often take longer (150 milliseconds) in latest cURL

From: Andreas Malzahn <andreas.malzahn_at_fastprotect.net>
Date: Fri, 12 Jul 2013 16:42:48 +0200

Hi,

 

When upgrading our application from cURL version 1.25 to 1.31, many HTTP
requests take now longer - time increased from 40- 60ms to 151ms.

Our application does many HTTP requests per second to localhost using curl
easy interface. (TMS server)

 

I traced the problem back to curl_easy_perform(CURL *easy)in easy.c where

            Curl_wait_ms(sleep_ms);

gets called with sleep_ms == 150, i.e. without_fds == 3.

 

When I change the line that calculates sleep_ms (line 536):

                sleep_ms = without_fds * 50;

to:

                sleep_ms = without_fds * 5;

 

the HTTP requests return much faster again.

 

Is there a special reason for the 50ms wait?

Maybe this is some bug and 5-10ms wait would be better?

 

I also tried to find out why our application runs into the waiting
without_fds, but had no luck because it never happens when debugging because
then the timing is different. Can someone explain when curl_multi_wait()
cannot wait on a filedescriptor, so the Curl_wait_ms() gets called?

 

Thank you,

Andreas

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-07-12