From 94164fae0499472b04959363dede02b93698f896 Mon Sep 17 00:00:00 2001 From: Jonny Hatch Date: Tue, 17 Nov 2020 07:45:48 -0700 Subject: [PATCH] Increase session pool size to 500 --- exchangelib/protocol.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exchangelib/protocol.py b/exchangelib/protocol.py index 513503e3..e9981c50 100644 --- a/exchangelib/protocol.py +++ b/exchangelib/protocol.py @@ -39,7 +39,11 @@ class BaseProtocol(object): # The maximum number of sessions (== TCP connections, see below) we will open to this service endpoint. Keep this # low unless you have an agreement with the Exchange admin on the receiving end to hammer the server and # rate-limiting policies have been disabled for the connecting user. - SESSION_POOLSIZE = 4 + # This pool is shared across all accounts that are using the same service account in a single + # process, so we need it to be high enough that our greenlets aren't blocking waiting for a session. + # Since we manage our own connections well, we don't need to worry about exchangelib throttling + # our connections for us. + SESSION_POOLSIZE = 500 # We want only 1 TCP connection per Session object. We may have lots of different credentials hitting the server and # each credential needs its own session (NTLM auth will only send credentials once and then secure the connection, # so a connection can only handle requests for one credential). Having multiple connections ser Session could