Uploaded image for project: 'James Imap'
  1. James Imap
  2. IMAP-371

MailboxManager::getMailbox called very often

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.3
    • None
    • Processor
    • None

    Description

      MailboxManager::getMailbox(MailboxPath mailboxPath, MailboxSession session) is getting called extremely often.
      On my custom RDBMS-based Mailstore implementation it is the biggest hot spot.
      I had to resort to caching the return value of it on Memcache, but even after that it uses up around 15% of spent CPU time. It is far too much in my opinion. (before I started caching it, fully indexed RDBMS getting of the mailbox was taking more than 50% of the global RDBMS load).

      My suspect is the method AbstractMailboxProcessor::addFlagsResponses(final ImapSession session, final SelectedMailbox selected, final ImapProcessor.Responder responder, boolean useUid).
      It gets the mailbox from MessageManager each time, even if it may be not needed.
      This method is called in many CommandProcessors during the unsolicitedResponses phase.
      After I am able to really profile and confirm that it's the core of problem, I will provide a patch.

      Attachments

        Activity

          People

            eric@apache.org Eric Charles
            arusin Andrzej Rusin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: