imapc fetch optimization

Nagy, Attila
Mon, 04 May 2015 13:59:02 -0000

Hi,

On 05/04/15 10:59, Timo Sirainen wrote:
> On 28 Apr 2015, at 23:49, Nagy, Attila <bra at fsn.hu> wrote:
>> Hi,
>>
>> imapc does a lot of UID FETCH $UID (BODY.PEEK[]), which is nice,
because it works even with the dumbest IMAP server, altough it really kills
performance, especially on high latency lines.
>>
>> I wonder: if IMAP servers can effectively handle boundless fetches
(like a list with all wanted UIDs, or simply 1:* if all are needed), do you see
this as a good addition to develop?
> Set mail_prefetch_count = 10 or 100 or something and it'll do larger
FETCHes. The higher the value, the more memory/disk space is used for storing
the received mails.
>
I'm aware of that, but it doesn't, or at least not always.
For example Thunderbird issues this:
13 UID fetch 333574:333601,333630:333801 (UID RFC822.SIZE FLAGS
BODY.PEEK[HEADER.FIELDS (From To Cc Bcc Subject Date Message-ID Priority
X-Priority References Newsgroups In-Reply-To Content-Type Reply-To)])
Dovecot does this to the IMAP backend
18 UID FETCH 333574 (BODY.PEEK[])
19 UID FETCH 333575 (BODY.PEEK[])
20 UID FETCH 333576 (BODY.PEEK[])
21 UID FETCH 333577 (BODY.PEEK[])
And so on.

I have mail_prefetch_count set to 100:
# doveconf -n | grep prefet
mail_prefetch_count = 100