Skip to content

Commit 4ed7fec

Browse files
lightiversonKawish Gajadientiwarishubham635
authored
fix: increase pool_maxsize (#714) (#716)
Co-authored-by: Kawish Gajadien <kawishg@outlook.com> Co-authored-by: Shubham <tiwarishubham635@gmail.com>
1 parent 1fb82e5 commit 4ed7fec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

twilio/http/http_client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import logging
23
from typing import Dict, Optional, Tuple
34

@@ -39,7 +40,10 @@ def __init__(
3940
self.session = Session() if pool_connections else None
4041
if self.session and max_retries is not None:
4142
self.session.mount("https://", HTTPAdapter(max_retries=max_retries))
42-
43+
if self.session is not None:
44+
self.session.mount(
45+
"https://", HTTPAdapter(pool_maxsize=min(32, os.cpu_count() + 4))
46+
)
4347
self.request_hooks = request_hooks or hooks.default_hooks()
4448
self.proxy = proxy if proxy else {}
4549

0 commit comments

Comments
 (0)