title: How is HTTP ChunkSize chosen?
body: <p>I've been tinkering in C to handle PUT requests that use <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding#Chunked_encoding" rel="nofollow noreferrer">Chunked</a> Encoding, and <a href="https://stackoverflow.com/a/2127723/9488865">this answer</a> has been immensely helpful.</p>
  
  <p>While handling incoming datastreams, I noticed <code>curl</code> seems to use <code>16372</code> as the max Chunklen, </p>
  
  <pre><code>--&gt; ChunkSize string: 3ff4 Dec: 16372
  --&gt; ChunkSize string: 3ff4 Dec: 16372
  --&gt; ChunkSize string: 1e7d Dec: 7805
  --&gt; ChunkSize string: 0 Dec: 0
  </code></pre>
  
  <p>and Golang seems to use <code>32768</code> as max:</p>
  
  <pre><code>--&gt; ChunkSize string: 8000 Dec: 32768
  --&gt; ChunkSize string: 8000 Dec: 32768
  --&gt; ChunkSize string: 1e1d Dec: 7709
  --&gt; ChunkSize string: 0 Dec: 0
  </code></pre>
  
  <p>How are ChunkLens chosen by say, curl? Is there a rhyme or reason to choose <code>16372</code>, <em>which btw is not divisible by 8:</em></p>
  
  <pre><code>&gt;&gt;&gt; 16372 / 8
  2046.5
  </code></pre>
  
  <p>When sending a large file, why shouldn't we use a larger chunksize? Anything else I should be aware of when it comes to chunksize?</p>
  
  <p>thanks!</p>