curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Response time appears to be much higher on 7.78 version of libcurl (vs 7.60 version)

From: Question Throwaway via curl-library <curl-library_at_lists.haxx.se>
Date: Fri, 17 Sep 2021 16:43:22 -0500

Hello all,

I'd like to preface this message by explaining my current setup and how I
use libcurl, and that I've at least isolated it to the libcurl realm (I
think):

- I use libcurl in OpenWRT
- I compile libcurl with ca-bundle and mbedtls
- I use libcurl to make requests and gather response times - where the
response time critical to the functionality of the app - and have been
running libcurl 7.60 for over a year with very consistent results

Using the above, I've setup a couple of tests where I send HTTP requests to
a web server, and made a super simple (and hacked together) test to
visually see the difference. The network conditions for both of the tests
I've done are exactly the same, so I don't believe it's a network related
issue.

(Code /libcurl setup)

#include <stdio.h>

#include </usr/local/include/curl/curl.h>

#include <string.h>

#include <stdlib.h>

#include <unistd.h>



int main()

{

                CURL * curlhandle = curl_easy_init();

                char url[500] = "https://google.com";



                if(curlhandle == NULL)

                {

                                return 0;

                }

                curl_easy_setopt(curlhandle, CURLOPT_URL, url);



                char version[500];

                sprintf(version, "Version: %s \n", curl_version());

                puts(version);

                curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 1L);



                curl_easy_setopt(curlhandle, CURLOPT_IPRESOLVE,
CURL_IPRESOLVE_V4);

                curl_easy_setopt(curlhandle, CURLOPT_TIMEOUT, 30L);

                curl_easy_setopt(curlhandle, CURLOPT_CONNECTTIMEOUT, 45L);

                curl_easy_setopt(curlhandle, CURLOPT_NOSIGNAL, 1L);

                curl_easy_setopt(curlhandle, CURLOPT_HTTP_VERSION,
CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE);

                curl_easy_setopt(curlhandle, CURLOPT_ACCEPT_ENCODING, "");

                curl_easy_setopt(curlhandle, CURLOPT_FOLLOWLOCATION, 1L);

                curl_easy_setopt(curlhandle, CURLOPT_MAXREDIRS, 2);

                curl_easy_setopt(curlhandle, CURLOPT_CAINFO,
"certificate.pem");

               curl_easy_setopt(curlhandle, CURLOPT_PROTOCOLS,
CURLPROTO_HTTPS);

                curl_easy_setopt(curlhandle, CURLOPT_SSL_ENABLE_ALPN, 1L);



                char requestStr[500];

                sprintf(requestStr, "Making 100 requests to %s \n", url);

                puts(requestStr);



                double response_time = 0.0;

                char str[900000];

                char avg[900000];

                long response = 0;

                double total_response_times = 0.0;
curl_easy_perform(curlhandle);

                                curl_easy_getinfo(curlhandle,
CURLINFO_RESPONSE_CODE, &response);

                                curl_easy_getinfo(curlhandle,
CURLINFO_TOTAL_TIME, &response_time);



                                sprintf(str, "Response time for %d: %lf
\n", i, response_time);

                                puts(str);



                                total_response_times = total_response_times
+ response_time;

                }



                average_response_time = total_response_times /
numIterations;



                sprintf(avg, "Response time average for %s for %i
iterations: %lf \n", url, numIterations, average_response_time);

                puts(avg);



                curl_easy_cleanup(curlhandle);



                return 0;

}


With 7.60 I regularly will get an average of 450-500MS response time

With 7.78 I regularly get between 4000-5500MS response time


This just doesnt seem right to me, and the only way I've found to fix the
issue with my actual app I run on my device is by 'frankenstein'ing the old
version of libcurl into the new firmware. I FEEL as if I'm just missing a
new setting or something has just changed, but I've gone up and down
through the libcurl documents, and still can't figure out what I might be
missing. I'm really hoping that maybe someone on this list might have
noticed the same thing / know what I might be missing.

Thanks in advance,


-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2021-09-17