[Dovecot] imap daemon consuming all the cpu
Hello,
I've tried to do a full text search on the inbox, it run fine, but the imap daemon started to eat all the CPU until I closed the email client.
I'm running dovecot 1.0.rc7 [using kqueue] on FreeBSD 6.1.
ktrace shows this pattern over and over (its seems to be looping):
49021 imap CALL kevent(0x4,0,0,0x80df000,0x5,0xbfbfe988) 49021 imap RET kevent 1 49021 imap CALL gettimeofday(0x80d0b00,0x80d0b08) 49021 imap RET gettimeofday 0 49021 imap CALL gettimeofday(0x80d0b00,0x80d0b08) 49021 imap RET gettimeofday 0 49021 imap CALL kevent(0x5,0,0,0xbfbfe930,0x1,0xbfbfe928) 49021 imap RET kevent 1 49021 imap CALL gettimeofday(0xbfbfe990,0) 49021 imap RET gettimeofday 0
Maybe this is useless to track the cause... :(
Unfortunately(?) I can't reproduce this again, because searches run OK.
Best regards, Rui Lopes
Hi, Rui Lopes wrote:
I've tried to do a full text search on the inbox, it run fine, but the imap daemon started to eat all the CPU until I closed the email client.
I'm running dovecot 1.0.rc7 [using kqueue] on FreeBSD 6.1.
ktrace shows this pattern over and over (its seems to be looping):
49021 imap CALL kevent(0x4,0,0,0x80df000,0x5,0xbfbfe988) 49021 imap RET kevent 1 49021 imap CALL gettimeofday(0x80d0b00,0x80d0b08) 49021 imap RET gettimeofday 0 49021 imap CALL gettimeofday(0x80d0b00,0x80d0b08) 49021 imap RET gettimeofday 0 49021 imap CALL kevent(0x5,0,0,0xbfbfe930,0x1,0xbfbfe928) 49021 imap RET kevent 1 49021 imap CALL gettimeofday(0xbfbfe990,0) 49021 imap RET gettimeofday 0
Maybe this is useless to track the cause... :(
Unfortunately(?) I can't reproduce this again, because searches run OK.
I'm was able to reproduce this problem. The attached patch will fix the problem. Best regards, Rui Lopes # Fix the problem "described" at: # # http://dovecot.org/pipermail/dovecot/2006-August/015656.html # http://dovecot.org/pipermail/dovecot/2006-August/015749.html # # This problem can be easily triggered: open a telnet session to your # imap server, login, select inbox, enter idle mode, create a file # inside your Maildir/new/ directory, and watch the cpu spin. # # -- Rui Lopes (rgl ruilopes com) --- src/lib/ioloop-notify-kqueue.c.orig Sat Aug 26 00:37:47 2006 +++ src/lib/ioloop-notify-kqueue.c Sat Aug 26 01:24:56 2006 @@ -111,7 +111,10 @@ io->callback = callback; io->context = context; - EV_SET(&ev, fd, EVFILT_VNODE, EV_ADD, + /* EV_CLEAR flag is needed because the EVFILT_VNODE filter reports + * event state transitions and not the current state. With this flag, + * the same event is only returned once. */ + EV_SET(&ev, fd, EVFILT_VNODE, EV_ADD | EV_CLEAR, NOTE_DELETE | NOTE_WRITE | NOTE_EXTEND | NOTE_REVOKE, 0, io); if (kevent(ctx->kq, &ev, 1, NULL, 0, NULL) < 0) { i_error("kevent(%d, %s) for notify failed: %m", fd, path);
participants (1)
-
Rui Lopes