title: How to force curl to use more TCP connections?
body: <p>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.</p>
  <p>By accident, I found using the <a href="https://pkg.go.dev/cloud.google.com/go/storage" rel="nofollow noreferrer">golang SDK</a> would reach 1GBps in this same environment, accessing the same file, with the same limit for outstanding requests.</p>
  <p>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.</p>
  <p>I tried to set the <a href="https://curl.se/libcurl/c/CURLMOPT_MAX_HOST_CONNECTIONS.html" rel="nofollow noreferrer">CURLMOPT_MAX_HOST_CONNECTIONS</a> to 0, which means unlimited, but I still get &lt; 10 TCP connections.</p>
  <p>I want to know, how can I make more TCP connections with CURL? It seems to me that CURL manages the connections itself?</p>