james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Charles <e...@apache.org>
Subject Re: IMAP: SelectedMailboxImpl performance
Date Wed, 31 Jul 2013 15:39:40 GMT
(see inline)

On 07/31/2013 03:37 PM, Jan-Philipp Niewerth | invencom wrote:
> Dear imap developers,
>
> we are using James 3 trunk in production for several weeks now. Great
> work! The impression we got is that is already very stable at least in
> our use case.
> My personal mailbox is also running on that James IMAP server now. We
> are using JPA/MySQL for mail storage. I am a big fan of huge mailboxes
> (15000 mails/folder). After fixing three minor issues
> (MAILBOX-197,MAILBOX-198,IMAP-375) Thunderbird and the mailclient on my
> smartphone run smoothly even with those mailboxes.
> There is only one thing left that bugs me: mailbox selection performance
>

Impressed!

> Selecting a mailbox with 15000 mails takes 5 seconds on our server while
> that one has 100% CPU load.
> This is caused by class SelectedMailboxImpl which fetches all mails from
> backing store mainly to achieve the following goals:
>   (a) determine applicable flags
>   (b) determine highestUid
>   (c) determine highestMsn (aka message count)
>   (d) create and maintain a MSN<>UID mapping
> As far as I can see (a),(b) and (c) could be efficiently computed by the
> store without fetching all mails.
>

So you mean having in the api such computed field? This would impact of 
store impl (jpa, maildir...). There may be also implication on 
concurrency (multiple sessions accessing the same mailbox). But yes, 
sounds like something helpful.

> Regarding (d):
> I did some traces of real IMAP sessions on the TCP level. As far as I
> can see most modern clients (at least the clients used by me) do not use
> MSNs. Instead they do all the commands based on the UIDs. So perhaps the
> MSN<>UID mapping could be lazily created when it is used the first time
> (if it is used at all).
>

Don't forget to read sections 2.3.1. (Message Numbers) of RFC "501

http://www.ietf.org/rfc/rfc3501.txt

    Messages in IMAP4rev1 are accessed by one of two numbers; the unique
    identifier or the message sequence number.

Indeed, using a lazy approach will help.

> So here comes my question: Is anybody working in this area already or
> would it make sense if I take a deeper look at it?
>

Go ahead :)

> Regards,
>
> Jan-Philipp Niewerth
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message