Python2 HTTPAdapter: How to Handle Persistent Connections and Timeouts Effectively?

18 Replies, 1671 Views

Wow, thanks for all the suggestions, folks! I tried tweaking the `pool_connections` and `pool_maxsize` settings, and it’s definitely helping with the persistent connection issues. Still not perfect, but better than before.

I also gave `urllib3` a shot, and it’s way more flexible than Python2 HTTPAdapter. The timeout handling is much better, though I’m still figuring out the best config for my use case.

One question though—has anyone tried combining `requests` with `tenacity` for retries? I’m curious if it’s worth the effort.

Thanks again for all the tips! You guys are lifesavers.

Messages In This Thread



Users browsing this thread: 1 Guest(s)