title: Python Requests URLLib3 Connection Pool Size
body: <p>In my application, I am sending off several <code>request.post()</code> requests in threads. Depending on the amount of data I have to post, the number of threads created can be in their hundreds. </p>
  
  <p>The actual creation of the <code>request</code> object is made using <code>requests-oauthlib</code>, which inserts authentication data into the <code>request</code> object when it is used.</p>
  
  <p>My issue is that when there is a large amount of data being sent in parallel, that the log is flooded with the following messages, and eventually no more input is sent to the log:</p>
  
  <p><code>Connection pool is full. Discarding connection.</code></p>
  
  <p>My question is, with the use of <code>requests-oauthlib</code>, is there a way to specity, perhaps within the <code>post</code> method itself, the size of the connection pool, or whether it should block so that other requests can complete before creating more? I ask for this because with the use of <code>requests-oauthlib</code>, it would be tricky to construct a custom <code>request</code> object, and ask <code>requests-oauthlib</code> to use it.</p>
  
  <p>One thing I have tried is as follows, but it had no effect - I continued to get the warnings:</p>
  
  <pre><code>import requests
  s = requests.Session()
  a = requests.adapters.HTTPAdapter(pool_block=True)
  s.mount('http://', a)
  s.mount('https://', a)
  </code></pre>
  
  <p><strong>Update - The threads are now being created in a controlled manner.</strong></p>
  
  <pre><code>with futures.ThreadPoolExecutor(max_workers=10) as executor:
      executor.submit(function, args)
  </code></pre>