How to force curl to use more TCP connections?

Viewed 46

I have a program in C++, which uses CURL to send/receive HTTP requests to read blobs in GCS (and other stuff). The ingestion throughput is ~150MBps.

By accident, I found using the golang SDK would reach 1GBps in this same environment, accessing the same file, with the same limit for outstanding requests.

I tried to see the difference between the C++ and golang programs. One thing I noticed is the golang program establishes 45 TCP connections, while the C++/CURL program establishes only 4 connections.

I tried to set the CURLMOPT_MAX_HOST_CONNECTIONS to 0, which means unlimited, but I still get < 10 TCP connections.

I want to know, how can I make more TCP connections with CURL? It seems to me that CURL manages the connections itself?

1 Answers
Related