title: Can you explain why there's a lot of TCP connections openned when running multiple requests?
body: <p>I try to understand why there's a lot of openned TCP connection when I running a lot of synchronous requests.</p>
  
  <p>In Windows, I use Python 3 to open a HTTP test server in a console:</p>
  
  <pre class="lang-sh prettyprint-override"><code>python -m http.server 9000
  </code></pre>
  
  <p>In a Git Bash console, I launch a lot of requests with a loop:</p>
  
  <pre class="lang-sh prettyprint-override"><code>for i in $(seq 1000); do curl http://localhost:9000/; done
  </code></pre>
  
  <p>During the requests, I see a lot of TCP connections related to the curl client and the Python server. The number of openned TCP connections increases over time as you can see in the screenshot.
  After some times, connections are closed.</p>
  
  <p><a href="https://i.stack.imgur.com/PGe5S.png" rel="nofollow noreferrer">Screenshot of Windows Ressource Monitor</a></p>
  
  <p>Why the connections are still opened ?</p>
  
  <p><strong>Edit 1:</strong></p>
  
  <p>With one curl command, I can see a openned connection during 2 minutes with <code>netstat -n | grep :9000</code>:</p>
  
  <pre><code>  TCP    127.0.0.1:64301        127.0.0.1:9000         TIME_WAIT
  </code></pre>
  
  <p>Changing the TTL does not change the duration of the openned request. </p>