-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
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
Current coverage is 97.57% (diff: 100%)@@ 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
|
@@ -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. |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that sounds good.
Looks good. Straightforward change. Just had a question about the existing name. |
@kyleknap renamed. |
Thanks. Looks good. 🚢 |
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: |
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 thediscussion from #766.
There ends up being quite a noticeable difference whenever
num_threads > max_pool_connection
, so I think this willhelp 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