MBOX-Line: From tss at iki.fi  Fri Mar 23 18:13:19 2012
To: imap-protocol@u.washington.edu
From: Timo Sirainen <tss@iki.fi>
Date: Fri Jun  8 12:34:48 2018
Subject: [Imap-protocol] IDLE + inbox file
In-Reply-To: <F88F7C11-F69D-4A7D-9376-D050D4B0F97B@iki.fi>
References: <11E08CAD-B343-4845-9C33-1DA80AFD652E@psu.edu>
	<1234979693.29240.1770.camel@timo-desktop>
	<alpine.OSX.2.00.0902181017110.34559@hsinghsing.panda.com>
	<1234981810.29240.1785.camel@timo-desktop>
	<53E653CF-EDA4-4B4B-8B1E-E1EAF6C29B36@imap.cc>
	<alpine.OSX.2.00.0902181047070.34559@hsinghsing.panda.com>
	<A9124E0E-76A1-4853-AEC6-2F7D519754B7@mac.com>
	<F88F7C11-F69D-4A7D-9376-D050D4B0F97B@iki.fi>
Message-ID: <694AC956-B34C-4E9F-83B3-45FB6AFA248D@iki.fi>

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.


