This repository was archived by the owner on Mar 13, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 2020
2121from __future__ import absolute_import
2222
23+ import multiprocessing
2324import logging
2425import sys
2526
@@ -83,11 +84,12 @@ def __init__(self):
8384 # Set this to True/False to enable/disable SSL hostname verification.
8485 self .assert_hostname = None
8586 # urllib3 connection pool's maximum number of connections saved
86- # per pool. Increasing this is useful for cases when you are
87- # making a lot of possibly parallel requests to the same host,
88- # which is often the case here.
89- # When set to `None`, will default to whatever urllib3 uses
90- self .connection_pool_maxsize = None
87+ # per pool. urllib3 uses 1 connection as default value, but this is
88+ # not the best value when you are making a lot of possibly parallel
89+ # requests to the same host, which is often the case here.
90+ # cpu_count * 5 is used as default value to increase performance
91+ # This is used because it's the default value for ThreadPoolExecutor
92+ self .connection_pool_maxsize = multiprocessing .cpu_count () * 5
9193 # http proxy setting
9294 self .http_proxy_url = None
9395
You can’t perform that action at this time.
0 commit comments