title: Python, threading, and requests: What happens when I make concurrent requests in one session?
body: <p>Let's say I make 5 requests via a requests.Session to a server, using a ThreadPoolExecutor:</p>
  
  <pre><code>session = requests.Session()
  executor = concurrent.futures.ThreadPoolExecutor(max_workers=5)
  
  def post(data):
      response = mysession.post('http://example.com/api/endpoint1', data)
      return response
  
  for data in (data1, data2, data3, data4, data5):
      executor.submit(post, data)
  </code></pre>
  
  <p>Since we are using the same requests.Session for each request, do we have to wait for the server to acknowledge the first request before we can send the next one?</p>
  
  <p>If I had 5 sessions open concurrently -- one session per thread -- would I be able to send the requests more rapidly by sending each request via its own session?</p>
  
  <p>The maintainer already recommends <a href="https://github.com/requests/requests/issues/1871" rel="nofollow noreferrer">"one session per thread"</a> so it's certainly doable... but will it improve performance?</p>
  
  <p>Would I be better off using aiohttp and async?</p>