Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the battery drain for sending one http request in iPhone/iPad?

I want to know how much of the battery is drained if I do x number of HTTP requests.

In other words, if I want to let the iPhone battery be drained by 10%, how many HTTP request would I have to make?

Just to make it clear how I want to approach this calculation, it is perfect if the power usage during the handling of the response is not counted. If it is counted the answer would vary depending on the response length, making it a subjective and scenario-driven answer.

The goal is to let a developer optimize how many HTTP requests are justified, but they can only do this if they know the numbers.

like image 829
Samyak Bhuta Avatar asked Nov 24 '25 14:11

Samyak Bhuta


2 Answers

The short answer would be "don't do more http requests than needed".

The longer answer is that there is no such thing as a "standard" http request. You will need to measure the impact yourself with a defined set of requests/responses. Besides battery drainage you also need consider the justification for putting a heavy load on the users bandwidth. Some users are charged a lot of money for data transfer over e.g. 3G.

A lot of things can influence the metrics, including length of response, latency, bundling of connections, signal strength of carrier network, etc, etc, etc....

like image 82
Claus Broch Avatar answered Nov 27 '25 02:11

Claus Broch


There is no way to give a hard number for this as the result will vary depending on numerous conditions including the network conditions, physical conditions of the phone and battery, what apps are running in the background, etc.

The only way to get any kind of idea of this is to write an app that makes continuous HTTP request and measure the battery drain. Even that won't give you a real answer because of all of the variables.

The true answer, of course, if that if an http request is absolutely needed, then it is justified.

like image 23
sosborn Avatar answered Nov 27 '25 02:11

sosborn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!