Author Topic: Issues with large folders: IMAP downloading every message in folder, not caching  (Read 2799 times)

Offline nullrequest

  • Newbie
  • *
  • Posts: 6
I have a small (<10 users), single domain system, running Roundcube v1.4.2. There are several users with large inboxes, or other folders that cause the server to timeout.  Large folders seem to cause terrible performance issues and I've tried numerous different ways to fix (DB caching, etc).  It runs longer than the 3 minute max execution time limit and eventually just throws an error to the GUI and displays no messages until they refresh the page (F5).  I think I've been able to narrow down to what is happening, but I can't tell why or what is causing it.

After enabling IMAP debug, it appears that Roundcube downloads *every* email in the folder, in it's entirety when opening that folder.  I would've expected that it should either 1) only pull the current page's messages, or 2) only do this once and cache the files per message caching settings.

I have enabled DB cache (MariaDB) but it's still downloading the full folder contents whenever the user logs into Roundcube (well shorter than the caching duration).  I've attached my config file and IMAP log with debug enabled showing a single user logging in.  I snipped out the middle section, but just to shrink the file, trust me that it does download every one of the ~13,000 emails in the folder.

Can anyone help me figure out how to speed this up and stop the slow full folder downloads?

Offline alec

  • Hero Member
  • *****
  • Posts: 1,363
Your server does not support SORT, so to sort messages by date it needs to fetch all messages' date header. Set the sorting column to None, then it will use the UID and do not fetch all messages' headers.

BTW, according to the list of capabilities the server software looks very limited. Consider change to dovecot.

Offline nullrequest

  • Newbie
  • *
  • Posts: 6
Your server does not support SORT, so to sort messages by date it needs to fetch all messages' date header. Set the sorting column to None, then it will use the UID and do not fetch all messages' headers.

BTW, according to the list of capabilities the server software looks very limited. Consider change to dovecot.

@alec - Ah, that makes sense.  It also explains why some users seemed to be significantly impacted.  I thought enabling DB caching of emails would get around that (since it's trivial to sort results from a DB)?

I'll look into dovecot as an alternative. Thanks for the recommendation.

Offline alec

  • Hero Member
  • *****
  • Posts: 1,363
The way caching is implemented will probably not help much in this case.