This repository was archived by the owner on Mar 13, 2022. It is now read-only.
File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 20
20
21
21
from __future__ import absolute_import
22
22
23
+ import multiprocessing
23
24
import logging
24
25
import sys
25
26
@@ -83,11 +84,12 @@ def __init__(self):
83
84
# Set this to True/False to enable/disable SSL hostname verification.
84
85
self .assert_hostname = None
85
86
# 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
91
93
# http proxy setting
92
94
self .http_proxy_url = None
93
95
You can’t perform that action at this time.
0 commit comments