[Dovecot] IMAP IDLE - iPhone?

Ed W lists at wildgooses.com
Tue Aug 14 11:04:22 EEST 2012


On 10/08/2012 10:25, Timo Sirainen wrote:
>>> how does help me "save battery" if i have a folder-structure
>>> maintained by sieve if i do not get my new mails?
>> If you open 10 connections to IMAP server and will IDLE on them - your phone will wake up to reply for ping in every of that 10 connections.
>> Imagine if there will 100 folders?
> Like mentioned previously in this thread, you can disable the "ping"s in Dovecot. And even when they happen Dovecot makes them happen at the same time. So I think the power usage difference between 1 connection and 100 connections isn't much.


The battery consumption problem seems common, but understanding of it is 
poor...

The situation is simply:
- Waking up a 3G radio is expensive on power
- So prefer to do it less frequently and do a chunk of stuff, rather 
than doing a small amount of data quite frequently
- Every 30 mins is only 48 times a day.  Every 15 seconds is massively more
- Different 3G networks have different parameters set which will 
dramatically affect battery life.  ie they wait longer/shorter before 
allowing the radio to go idle once woken up. I don't know a good online 
resource to see these settings, my old Nokia had a utility to 
investigate things...
- Firewalls impose challenges on being silent for 30 mins at a time and 
may drop any NAT mappings
- The 3G network will almost certainly have a NAT in the way which 
guarantees you have a (probably very short) NAT timeout (perhaps 10 mins 
or perhaps less)
- Then there is tcp keepalive.  Does Dovecot enable these? (Sorry, I 
should look in the code...).  However, applications which enable it (eg 
optional in SSH) will trigger a default (I think) 75 second network packet

As Timo says, Dovecot tries to be clever and coalesce packets from 
checking multiple folders, but from memory there are limitations on this 
if you have multiple *accounts*?  I think the hash is per email address 
and per IP ?

But of course if your emails turn up every few seconds, then you will be 
triggering wakeups every few seconds also.

I think if you tune things with that in mind, it's very possible to get 
very low battery usage.  Using tcpdump on your mobile client to help 
tune things is a great help.  Basically every stray packet is a killer 
for battery, hunt them down.


Cheers

Ed W


More information about the dovecot mailing list