[Imap-protocol] IDLE + inbox file

Timo Sirainen tss at iki.fi
Fri Mar 23 18:13:19 PDT 2012


On 24.3.2012, at 2.48, Timo Sirainen wrote:


> b) If you care about power usage, then IDLE isn't much better from polling, because in either case the device needs to wake up every n minutes to do some work and send some data



This reminds me of an interesting optimization in Dovecot. I don't know if other servers do this. Since many clients open multiple IMAP connections, each of them IDLEing and each of them needing to be notified every 2 minutes, Dovecot notifies the connections at the same time, so that the device needs to wake up only once to handle them:

next_notify_secs = 120 - ((time() + crc32(username)) % 120);

The username crc32 is there so that the server doesn't cause a load peak every 2 mins by notifying everyone at the same time.



More information about the Imap-protocol mailing list