In a phone weather app fetching a 2 KB forecast every 20 seconds, why does the battery drain far more than the bytes suggest?
answer
- three radio states, not on and off
- waking up is slow, so it lingers
- the tail costs more than the bytes
- count wake-ups per hour, not kilobytes
- one burst instead of three a minute
basics
~20 sEach request wakes the cellular radio, which then lingers in high-power states for seconds after the transfer. A request every 20 seconds keeps it from ever reaching standby, so the energy goes on wake-ups and tails, not bytes.
solid answer
~50 sA cellular radio has roughly three states: **full power** while transferring, a **low-power** intermediate state, and **standby**. Climbing back up is slow (in one published 3G example about 1.5 s from low power and over 2 s from standby), so after a transfer the radio holds full power for a **tail** of a few seconds and then lingers at low power before standby. In that example every transfer keeps the radio drawing energy for at least about 18 s. A 2 KB request every 20 s therefore keeps the radio awake almost all the time: the cost is per wake-up, not per kilobyte. The fix is fewer wake-ups: refresh when the user opens the app, let the widget show the last cached forecast, let severe-weather warnings arrive by push, and send deferrable traffic in the same burst. Tail lengths vary by radio technology and carrier, so any figure is an assumption.
go deeper
Recall that the cellular radio has full, low and standby states and stays up for seconds after each transfer. The cost of a small request is the wake-up and the tail, so count requests, not bytes.
Explain the state machine and do the arithmetic with labelled assumptions: wake-ups per hour times seconds of radio per wake-up. Show why a 20-second poll never lets the radio reach standby.
Turn every timer into a line in the radio budget: who wakes it, how often, and what rides along. Replace polling with on-demand refresh, a cache-fed widget and push for urgent events, and prove it with per-release transfer counts.
Treat wake-ups per hour as a budget shared by every team and SDK in the app, since a third-party ping drains the same battery. Decide who may own a recurring wake-up and how a new one is reviewed.
## The radio is a state machine, not a switch A phone's cellular radio does not simply turn on for a request and off afterwards. It moves between power states, and the network, not the app, decides how long it stays in each one: - **Full power**: a connection is active and data moves at the highest rate. This is the expensive state. - **Low power**: an intermediate state that, in one published 3G example, draws roughly half as much. The radio gets back to full power faster from here than from standby. - **Standby**: no connection is active and the radio draws very little. Moving up is slow. In that published example, returning to full power takes around 1.5 s from low power and over 2 s from standby. To avoid paying that latency on every tap, the network keeps the radio in the higher states for a while after the last byte: the **tail**. The tail is configured by the carrier and differs between radio technologies (3G, LTE, 5G), so no single number holds everywhere, but every design has to assume some version of it. ## Where a small request's energy goes For one small forecast request, the energy splits into four parts: 1. **The wake-up**: the climb from standby or low power to full power, with its latency. 2. **The transfer**: for 2 KB, a fraction of a second even on a weak link. 3. **The tail at full power**: seconds of full-power drain after the transfer ends. 4. **The linger at low power**: more seconds before standby. Parts 1, 3 and 4 are the same whether the request carries 2 KB or 200 KB. For a small payload they are almost all of the cost, which is why shrinking the payload barely moves the battery graph. ## The arithmetic for the weather app The assumptions below are this scenario's, borrowed from the published 3G example; a real radio's numbers will differ: - a transfer of about 1 s on a weak rural link; - a tail of about 5 s at full power, then about 12 s at low power; - so roughly **18 s of radio energy per wake-up**. | Design | Wake-ups (assumed) | Radio drawing energy | |---|---|---| | Fetch every 20 s while the widget is on the home screen | 180 an hour | about 54 s of every 60 s; it never reaches standby | | One grouped 3 s transfer per minute | 60 an hour | about 20 s of every 60 s | | Fetch when the app opens; the widget reads the cache | a handful a day | seconds per hour | The published example makes the same point: a one-second transfer three times a minute keeps the radio perpetually active, while one three-second transfer per minute leaves it in standby for about 40 s of every minute. The bytes are identical; the number of wake-ups is not. ## What the design changes The question to ask of every timer in the app is "what wakes the radio, and how often?": - **Refresh on demand, not on a clock.** Fetch the forecast when the app comes to the foreground or the user pulls to refresh, and accept that the cached forecast is minutes old in between. - **Let the widget read the cache.** A widget that fetches on every redraw owns its own wake-ups; one that renders the forecast the app last stored owns none. When the OS lets a widget redraw at all is a separate, OS-imposed question. - **Let urgent warnings arrive by push.** A severe-weather warning reaches the phone through the platform's push channel instead of the app polling for it; the push design decides how. - **Group what can wait.** Logs, analytics batches and tiles not yet on screen should ride a wake-up the user already caused rather than make their own. - **Treat heartbeats as wake-ups.** A live connection that pings every 30 s costs roughly like a poll every 30 s. The connection's design chooses that interval; its radio cost still belongs in this budget. ## Why the numbers stay assumptions A strong answer states the tail as an assumption and moves on. Newer radio technologies have different state machines, carriers configure the timers, and the same phone behaves differently on two networks. What carries across all of them is the shape: a wake-up has a fixed cost far larger than a small payload's, so **the budget to manage is wake-ups per hour**. An interviewer grading this answer listens for that sentence, then for a redesign that cuts the count without making the forecast useless, and finally for a way to prove it in the field: counting the app's own transfers per hour, per release, on real devices over cellular rather than on an emulator that has no radio at all.
- Would shrinking the forecast response from 2 KB to 500 bytes fix the drain?Barely. For a small payload the transfer lasts a fraction of a second, while the wake-up and the tail take many seconds and do not depend on size. Cutting bytes helps the data plan and slow links; cutting the number of wake-ups is what helps the battery here. Measure wake-ups per hour before and after, not kilobytes.
- Does keeping one connection open avoid the wake-up cost?Only while nothing is sent. Every heartbeat, keep-alive or pushed update is a transfer that starts its own tail, so a connection pinging every 30 s costs roughly like a poll every 30 s. Reusing a connection does save handshakes inside a burst, but an idle-yet-chatty connection is still a stream of wake-ups. The interval itself is a trade the connection's design makes against network idle timeouts.
- How would you prove in the field that a release fixed the drain?Instrument the app's own transfers: count requests per hour and how many start within a few seconds of the previous one, sliced by release and network type. A fix shows as fewer, larger bursts. Pair it with battery-related reviews and support tickets, and verify on a real phone over cellular, since an emulator on a desk has no radio tail.
A taxi with a large minimum fare: twenty short rides cost twenty minimum fares, while one longer ride that runs all the errands at once costs one. The distance driven matters far less than how many times you hail the cab.
- A 2 KB request is too small to matter for the battery.
- Battery cost scales with bytes sent, so compressing the poll fixes the drain.
- The radio drops to standby the instant the response arrives.
- Every network has the same five-second tail, so the arithmetic is exact.
- Moving the poll onto a background thread saves the battery.