[PATCH] Set maxconnections default to 2

Sebastian Spaeth Sebastian at SSpaeth.de
Sun Mar 6 09:20:14 GMT 2011


Multithreading speeds up account syncing a lot and the offlineimap
defaults are very conservative. Let's make it use 2 IMAP connections by
default to gain some of the benefits that offlineimap offers.

Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
---
I propose to make multithreading in offlineimap the default. 
Even thunderbird uses more than 1 connection. This patch is against current master.

 offlineimap.conf    |    2 +-
 offlineimap/init.py |    8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/offlineimap.conf b/offlineimap.conf
index d3be8be..cf731a4 100644
--- a/offlineimap.conf
+++ b/offlineimap.conf
@@ -341,7 +341,7 @@ remoteuser = username
 # cases, it may slow things down.  The safe answer is 1.  You should
 # probably never set it to a value more than 5.
 
-maxconnections = 1
+maxconnections = 2
 
 # OfflineIMAP normally closes IMAP server connections between refreshes if
 # the global option autorefresh is specified.  If you wish it to keep the
diff --git a/offlineimap/init.py b/offlineimap/init.py
index 8aebb23..8029470 100644
--- a/offlineimap/init.py
+++ b/offlineimap/init.py
@@ -295,8 +295,9 @@ class OfflineImap:
             remoterepos = None
             localrepos = None
     
-            threadutil.initInstanceLimit("ACCOUNTLIMIT",
-                                         config.getdefaultint("general", "maxsyncaccounts", 1))
+            threadutil.initInstanceLimit('ACCOUNTLIMIT',
+                                    config.getdefaultint('general',
+                                                         'maxsyncaccounts', 1))
     
             for reposname in config.getsectionlist('Repository'):
                 for instancename in ["FOLDER_" + reposname,
@@ -305,7 +306,8 @@ class OfflineImap:
                         threadutil.initInstanceLimit(instancename, 1)
                     else:
                         threadutil.initInstanceLimit(instancename,
-                                                     config.getdefaultint('Repository ' + reposname, "maxconnections", 1))
+                               config.getdefaultint('Repository ' + reposname,
+                                                    'maxconnections', 2))
             siglisteners = []
             def sig_handler(signum, frame):
                 if signum == signal.SIGUSR1:
-- 
1.7.1





More information about the OfflineIMAP-project mailing list