Author Topic: Minimizing data usage - push vs poll  (Read 13143 times)

AC3

  • Newbie
  • *
  • Posts: 5
Minimizing data usage - push vs poll
« on: January 16, 2013, 06:33:38 pm »
Hi! New to AquaMail (and 'droid GS3...coming from BB). Kostya, I love your app compared to K-9 or stock...it works great, wonderfully configurable and I will be purchasing the Pro key.

I'm trying to figure out what method of fetching messages would be the 'lightest' on data usage while I am roaming (I live in Canada, but roaming at my summer cottage in the US). My BB service was really friendly in that aspect....hardly used any roaming data or background OS activity...a 3 day weekend worth of emails and some messaging would only eat maybe 250kb total. Don't think I'll be seeing that anymore with 'droid, just seeing how much background stuff goes on.

Being 45 minutes from the closest hotspot, even if I disable or firewall all the other apps/services, the only thing I'd want to keep running is AquaMail....just to see the headers or a few kb, so at least I'm not missing anything from customers or my office and know what need a quick reply.

I have 2 POP and 2 IMAP (gmail) accounts that I'd be accessing. I have read about imap push being more power hungry than say 15 or 30 minute polling, but curious which method would use less data to sync? Would imap idle use more just because of the idle keep-alive packets (or the gmail 'tickle')? Or would polling use more?

Aside from going to a fully manual sync only, which automatic method / settings would be the leanest on roaming  - poll every xx minutes, headers only, only inbox folders...something on those lines?

And would I be able to manage what I was hoping for - firewalling everything but AquaMail while US roaming...or do the other OS dependancies need full network access to allow AquaMail to work?

Thanks....great forum, btw!

stapoz

  • Newbie
  • *
  • Posts: 3
Re: Minimizing data usage - push vs poll
« Reply #1 on: January 21, 2013, 04:07:15 pm »
So imap push consumes more battery than 15min auto pull?  ???
I thought push method activates aqua only when new mail signal is received (plus few bytes long keep-alive message every 10mins)....

At my operator an active session contains of packets of 100kB each. So even if the app send 1B and no internet activity - 100kB is added to my data amount  >:(
« Last Edit: January 21, 2013, 05:02:29 pm by stapoz »

doctorow

  • Jr. Member
  • **
  • Posts: 87
Re: Minimizing data usage - push vs poll
« Reply #2 on: January 22, 2013, 12:56:29 am »
So imap push consumes more battery than 15min auto pull?  ???
I thought push method activates aqua only when new mail signal is received (plus few bytes long keep-alive message every 10mins)....

At my operator an active session contains of packets of 100kB each. So even if the app send 1B and no internet activity - 100kB is added to my data amount  >:(

IMAP push, or IMAP IDLE, still requires a permanent stateful TCP connection to your email provider. It is different than BES from Blackberry, where your phone gets notified by the carrier when new mail arrives without the need of the phone being constantly connected to the mail server.

In order to keep that connection from failing, the e-mail client, Aqua Mail, needs to send periodical keep-alive packets. Otherwise your carrier or Internet router will drop the connection.

That said, there is no way of telling in general whether pull or push is more efficient. It depends on a number of variables. How stable is your internet connection (the less stable, the more keep-alive packets are needed)? How many folders are you monitoring (IMAP IDLE can only monitor a single folder per connection)? How frequently do you get new emails? For instance, if you get a lot of mail (let's say mail every few minutes), IMAP IDLE (push) will always be expensive.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12742
Re: Minimizing data usage - push vs poll
« Reply #3 on: February 21, 2013, 01:57:22 am »
About the battery use of IMAP IDLE: in the words of the late Steve Jobs, "It's a power hog".

What @doctorow referred to above is something that appears to be necessary on Android 4 and above (and no, none if it is documented anywhere).

In addition, in case we're talking about Gmail, its IMAP IDLE implementation is incomplete, since 2007:

https://groups.google.com/forum/?fromgroups=#!topic/hosted-the-basics/QMXBIwvzM5I

... and it "tickles" the app every five minutes in a way that can't be ignored a forces a (fairly quick) resync.

There is a good reason the native Gmail app does not use IMAP (and which is probably why nobody's in a hurry to fix Gmail's IMAP implementation -- "see, our app is so much better").

To make it short:

The most traffic friendly option (for roaming, etc) is POP3 with "preload headers only", marginally better than IMAP with "preload headers only", and IMAP in push mode will use more traffic and more battery.

One additional twist: when using IMAP, my app downloads attachments / inlines only as necessary, while with POP3, the entire message has to be downloaded when you open it, including attachments.

But, there is a setting (in global app settings, extended mode) to limit the max. message size that the app will automatically completely load when a message is opened. The default is 5K for mobile, and if the message is larger, you'll get two buttons: "Load up to 5K" vs "Load completely: xxxK".

Now of course all of this also depends on how much mail you actually receive and read: preloading headers only isn't going to save much traffic if the messages you receive have attachments, and you open them all the time.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/