Hi, My laptop runs a local IMAP server so that I'm immune from breaking my mail client, and when playing around with powertop I discovered that Dovecot (in particular imap-login) wakes up every 1000ms and then every 50ms even when no clients are connected. A bit of stracing shows this: gettimeofday({1180875699, 667917}, NULL) = 0 <0.000010> poll([{fd=7, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=10, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=3, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=0, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=1, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}], 5, 999) = 0 <0.999595> gettimeofday({1180875700, 667627}, {4294967236, 0}) = 0 <0.000007> gettimeofday({1180875700, 667670}, NULL) = 0 <0.000007> poll([{fd=7, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=10, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=3, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=0, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=1, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}], 5, 0) = 0 <0.000006> gettimeofday({1180875700, 667762}, {4294967236, 0}) = 0 <0.000007> gettimeofday({1180875700, 667801}, NULL) = 0 <0.000006> poll([{fd=7, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=10, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=3, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=0, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=1, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}], 5, 999) = 0 <0.999699> gettimeofday({1180875701, 667638}, {4294967236, 0}) = 0 <0.000010> Is there any reason why dovecot wakes up so frequently even when there is apparently nothing to do? If it is to perform some routine task, can this timeout be extended? There are many daemons on my machine (lighttpd is another) that are waking up every second when nothing is happening, and each of these is contributing to waking the CPU from sleep. Cheers, Ross -- Ross Burton mail: ross at burtonini.com jabber: ross at burtonini.com www: http://www.burtonini.com./ PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF
Timo Sirainen
2007-Jun-03 15:05 UTC
[Dovecot] Dovecot waking every 50ms when doing nothing
On Sun, 2007-06-03 at 14:06 +0100, Ross Burton wrote:> Hi, > > My laptop runs a local IMAP server so that I'm immune from breaking my > mail client, and when playing around with powertop I discovered that > Dovecot (in particular imap-login) wakes up every 1000ms and then every > 50ms even when no clients are connected. A bit of stracing shows this:I did once try to reduce these unnecessary wakeups, but then I thought it's probably not worth the trouble. No-one's going to run an IMAP server in their laptop.. :) This fixes it for imap/pop3-login: http://hg.dovecot.org/dovecot/rev/0021765627f3 Fixing dovecot-auth and dovecot processes is a bit more difficult. Patches welcome. :) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20070603/61afb3e3/attachment-0002.bin>