curl / Mailing Lists / curl-library / Single Mail


Re: Using libcurl sending much more HTTP request in parallel

From: Daniel Stenberg <>
Date: Thu, 17 Aug 2017 10:22:32 +0200 (CEST)

On Wed, 16 Aug 2017, Jack wrote:

> 1. curl_multi_socket_action, I pass active fd, but libcurl also do others
> fds,

For every call to curl_multi_socket_action(), libcurl will also take care of
other transfers that have a timer that has expired. None, one or many

If you call it with CURL_SOCKET_TIMEOUT, the difference is basically that
there's no "primary" file descriptor to check but it only runs through the
expired timers.

> SSL_CTX_load_verify_locations why consume 20ms every time? Openssl read
> /etc/pki/tls/certs/ca-bundle.crt once time, I don't change this file, why
> Openssl not cache this?

Ah right! Good detective work.

This is actually something we should put some work into. The example
cacertinmem.c [*] shows how it could be done to keep cacerts in memory or we
could just re-use the SSL "context" somehow (as that's where OpenSSL holds the
cacert data I believe). That loading of the CA cert, or loading a myriad of
tiny small CA cert files, can take a significant time. And as they rarely
change, they should be really good to cache.

[*] =

Received on 2017-08-17