I’m wondering whether a busy websocket connection uses significantly more battery on iOS than a sparsely utilized one - or if there is a constant overhead simply for maintaining the connection that dominates. This will inform some architectural decisions. Thanks!

closed as off-topic by amon, gnat, mattnz, Samuel, 8bittree Sep 29 '17 at 15:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking for assistance in explaining, writing or debugging code are off-topic here. These can be asked on Stack Overflow if they include the desired behavior, a specific problem or error, and the shortest code necessary to reproduce it in the question (see Minimal, Complete, and Verifiable Example)." – amon, gnat, mattnz, Samuel, 8bittree
If this question can be reworded to fit the rules in the help center, please edit the question.


According to this research paper: HTML5 Connectivity Methods and Mobile Power Consumption, you do consume a significant amount of energy maintaining an inactive websocket, because it is sending frequent messages back and forth to keep the connection alive. Ideally, you would send data at an interval where the websocket could utilize power-saving mechanisms such as "Fast Dormancy" or if the data is sent sporadically, use stateless AJAX requests with a self defined polling frequency.

  • 2
    Thanks for the reply. It doesn't quite answer my question though: in my use case, we have a single socket open. My question is whether the battery drain from that one socket will be significantly different if that websocket is streaming data consistently, versus streaming only sporadically. – Michael Piazza Sep 28 '17 at 22:14
  • 1
    @MichaelPiazza Hope that answers your question! – Ross Gatih Sep 30 '17 at 3:23
  • 3
    Whoever downvoted this to "-1" needs to rethink their life. Even if OP doesn't think his question is answered, as far as possible answers go this one is on the mark, even pointing to a good paper. It is as good as can be expected given the question. Some people need to educate themselves on the purpose of downvotes on this site! And by the way, I don't understand how this does not answer your question, @MichaelPiazza. I hope it wasn't you who downvoted. Your question cannot be answered more concretely, it is too unspecific and too broad. – Mörre Sep 30 '17 at 6:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.