title: C# HttpClient slow uploading speed
body: <p>I'm trying to upload large (50 MB - 32 GB) files to Google.Drive. I'm using google-api-dotnet which provides upload logic and encryption support. The main problem is slow uploading speed. </p>
  
  <p>I looked through api <a href="https://github.com/google/google-api-dotnet-client/blob/9c6c1930a4ac2e3a9ccd8655757a76b544442610/Src/GoogleApis/Apis/%5BMedia%5D/Upload/ResumableUpload.cs" rel="noreferrer">source code</a>. Each file is uploaded by chunks (I set chunk size to 4 MB) Each chunk is uploaded via new HttpRequestMessage instance. HttpClient is created once the api service started and reused for all requests. </p>
  
  <p>The upload speed is 600 kbytes/s and stable while my uplink is 10 times faster.</p>
  
  <p>I captured traffic with Wireshark:
  <img src="https://i.stack.imgur.com/fTfhr.png" alt="slow-uploading-screenshot"> 
  Each chunk is divided into hundreds or thousands small TLS packets. And for each small TLS packed a confirmation is expected. So the resulting speed is very low. </p>
  
  <p>But when I start Fiddler proxy, the speed becomes as fast as my uplink can do.
  The TLS packets going very fast in parallel and the confirmations are received later:
  <img src="https://i.stack.imgur.com/YYreb.png" alt="tls-packets-first-screenshot">
  <img src="https://i.stack.imgur.com/N2P3d.png" alt="tcp-ack-later"></p>
  
  <p>I tried my code on 5 PC's with Win7 and all showed similar low uploading speed. But when I tried on Win10 PC - the speed was very good.
  Also I tried Google.Drive client application and it had same problems with speed. 
  I tried to search about this behaviour, but I didn't found anything.</p>
  
  <ol>
  <li>Why are 4 MB chunks divided into 4 KB TLS packets? Can I increase TLS packets size?</li>
  <li>How can I make the TLS packets sending in parallel as Fiddler does?</li>
  <li>Or is there other methods of increasing upload speed? </li>
  </ol>