Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add max_pool_connections to client config #1026

Merged
merged 3 commits into from
Sep 12, 2016
Merged

Conversation

jamesls
Copy link
Member

@jamesls jamesls commented Sep 8, 2016

This config value allows you to control the size of the
connection pools used in urllib3. We were previously using the
hardcoded value of 10 (from requests).

I ended up not touching the pool_connections based on the
discussion from #766.

There ends up being quite a noticeable difference whenever
num_threads > max_pool_connection, so I think this will
help people running requests with a large number of threads.

As an aside, the implementation for this was much more complicated
than necessary. I'm thinking on sending a few follow up PRs that
start to clean up some of this technical debt.

Closes #773
Closes #766

cc @kyleknap @JordonPhillips

This config value allows you to control the size of the
connection pools used in urllib3.  We were previously using the
hardcoded value of 10 (from requests).

As an aside, the implementation for this was much more complicated
than necessary.  I'm thinking on sending a few follow up PRs that
start to clean up some of this technical debt.

Closes boto#773
Closes boto#766
@codecov-io
Copy link

codecov-io commented Sep 8, 2016

Current coverage is 97.57% (diff: 100%)

Merging #1026 into develop will increase coverage by <.01%

@@            develop      #1026   diff @@
==========================================
  Files            44         44          
  Lines          6884       6892     +8   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           6717       6725     +8   
  Misses          167        167          
  Partials          0          0          

Powered by Codecov. Last update 0917f55...148e205

@@ -75,7 +77,26 @@ def convert_to_response_dict(http_response, operation_model):


class PreserveAuthSession(Session):
"""Internal session class used to workaround requests behavior.

This class is intended to be used only by the Endpoint class.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the class should be renamed. It is no longer just for preventing the rebuilding of auth. It also is used to customize the adapter and the connection pool. Maybe call it BotocoreRequestsSession?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can rename it. Maybe something like BotocoreHTTPSession to disambiguate it from botocore.session.Session?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that sounds good.

@kyleknap
Copy link
Contributor

kyleknap commented Sep 9, 2016

Looks good. Straightforward change. Just had a question about the existing name.

@jamesls
Copy link
Member Author

jamesls commented Sep 12, 2016

@kyleknap renamed.

@kyleknap
Copy link
Contributor

Thanks. Looks good. 🚢

@alanhamlett
Copy link

alanhamlett commented Jul 31, 2018

Close the loop... could you link to docs on this and how to use it from boto3?

Found it can be passed to boto3 Client or Resource with:
botocore.client.Config(max_pool_connections=X)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants