Skip to content

Commit

Permalink
fix: increase pool_maxsize (#714) (#716)
Browse files Browse the repository at this point in the history
Co-authored-by: Kawish Gajadien <[email protected]>
Co-authored-by: Shubham <[email protected]>
  • Loading branch information
3 people authored Apr 22, 2024
1 parent 1fb82e5 commit 4ed7fec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion twilio/http/http_client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import logging
from typing import Dict, Optional, Tuple

Expand Down Expand Up @@ -39,7 +40,10 @@ def __init__(
self.session = Session() if pool_connections else None
if self.session and max_retries is not None:
self.session.mount("https://", HTTPAdapter(max_retries=max_retries))

if self.session is not None:
self.session.mount(
"https://", HTTPAdapter(pool_maxsize=min(32, os.cpu_count() + 4))
)
self.request_hooks = request_hooks or hooks.default_hooks()
self.proxy = proxy if proxy else {}

Expand Down

0 comments on commit 4ed7fec

Please sign in to comment.