The following issue has been RESOLVED. ====================================================================== http://www.dbmail.org/mantis/view.php?id=851 ====================================================================== Reported By: namailsj Assigned To: paul ====================================================================== Project: DBMail Issue ID: 851 Category: IMAP daemon Reproducibility: always Severity: major Priority: normal Status: resolved target: Resolution: fixed Fixed in Version: 2.2.17 ====================================================================== Date Submitted: 08-Jul-10 16:20 CEST Last Modified: 10-Aug-10 16:34 CEST ====================================================================== Summary: Slow IMAP results and high CPU usage when message_idnr is very big Description: IMAP SEARCH and SORT commands show big delay and dbmail-IMAPD uses 100% CPU when the emails in the mailbox have big message_idnr numbers ======================================================================
---------------------------------------------------------------------- (0003077) paul (administrator) - 10-Jul-10 17:42 http://www.dbmail.org/mantis/view.php?id=851#c3077 ---------------------------------------------------------------------- DBMail currently uses balanced binary trees to maintain ordered sets of UID values during searching, and recursive merging of search results. Though searching such a tree is fast, merging trees is slow since the tree will try to rebalance itself internally. Looks like we hit O(n) or maybe even O(!n) during g_tree_steal calls where n is the largest key in the tree. Not good. I'll start working on a better algorithm for building, sorting and merging search results that scales better, O(1) if possible. Maybe using hash maps will be viable. ---------------------------------------------------------------------- (0003078) namailsj (reporter) - 14-Jul-10 20:34 http://www.dbmail.org/mantis/view.php?id=851#c3078 ---------------------------------------------------------------------- Thanks Paul, let me know if I can assist in any kind of testing. Also, when do you expect a fix to be released. ---------------------------------------------------------------------- (0003084) paul (administrator) - 10-Aug-10 15:27 http://www.dbmail.org/mantis/view.php?id=851#c3084 ---------------------------------------------------------------------- Could you please provide the IMAP commands that respond too slowly here. Despite several attempts on multiple hosts using different combinations of packages, I'm still unable to reproduce this reliably using search. Sort does appear to be too slow. ---------------------------------------------------------------------- (0003085) paul (administrator) - 10-Aug-10 15:58 http://www.dbmail.org/mantis/view.php?id=851#c3085 ---------------------------------------------------------------------- Mmm, found the hot-spot involved. Finally! ---------------------------------------------------------------------- (0003086) paul (administrator) - 10-Aug-10 16:34 http://www.dbmail.org/mantis/view.php?id=851#c3086 ---------------------------------------------------------------------- Fixed it in the 2.2 branch. Issue History Date Modified Username Field Change ====================================================================== 08-Jul-10 16:20 namailsj New Issue 08-Jul-10 16:20 namailsj File Added: dbmail-log.txt 10-Jul-10 17:42 paul Note Added: 0003077 10-Jul-10 17:42 paul Assigned To => paul 10-Jul-10 17:42 paul Status new => confirmed 14-Jul-10 20:34 namailsj Note Added: 0003078 10-Aug-10 15:27 paul Note Added: 0003084 10-Aug-10 15:58 paul Note Added: 0003085 10-Aug-10 16:34 paul Note Added: 0003086 10-Aug-10 16:34 paul Status confirmed => resolved 10-Aug-10 16:34 paul Resolution open => fixed 10-Aug-10 16:34 paul Fixed in Version => 2.2.17 ====================================================================== _______________________________________________ Dbmail-dev mailing list Dbmail-dev@dbmail.org http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev