Skip to content

Commit d38f694

Browse files
make URLLIB3_POOL_SIZE configurable (#128)
Added flexibility for users to set the urllib3 connection pool size, this value can now be set in the range [10,100]
1 parent 881a57d commit d38f694

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/google/appengine/runtime/default_api_stub.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,16 @@
6868

6969
URLLIB3_POOL_COUNT = 10
7070

71-
URLLIB3_POOL_SIZE = 10
71+
POOL_SIZE_LOWER_LIMIT = 10
72+
POOL_SIZE_UPPER_LIMIT = 100
73+
POOL_SIZE_DEFAULT_VALUE = 10
74+
75+
URLLIB3_POOL_SIZE = int(
76+
os.environ.get('POOL_SIZE_URLLIB3', POOL_SIZE_DEFAULT_VALUE)
77+
)
78+
79+
if not (POOL_SIZE_LOWER_LIMIT <= URLLIB3_POOL_SIZE <= POOL_SIZE_UPPER_LIMIT):
80+
URLLIB3_POOL_SIZE = POOL_SIZE_DEFAULT_VALUE
7281

7382

7483

0 commit comments

Comments
 (0)