Top Banner
Interpreting the significance of Android energy optimisation by collecting large-scale usage information Andrew Rice June-2011
46

Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Sep 13, 2018

Download

Documents

hoangbao
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Interpreting the significance of Android energy optimisation by

collecting large-scale usage information

Andrew RiceJune-2011

Page 2: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Part 1: We want to know how much energy a particular action will

consume

Part 2: We want to know if this is significant in real usage

Page 3: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Example: joining the wireless network consumes 6 Joules

HTC G1 (or Magic), Android 1.1, 194 trials

Page 4: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

We measure energy consumption by intercepting the power supply

Power V1 x V

2

Both voltages are sampledat 250 kHz

Page 5: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Trace of the G1 boot process

HTC G1 (or Magic), Android 1.1

Page 6: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Joining a wireless network

HTC G1 (or Magic), Android 1.1

Page 7: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Access point beacons correlate with spikes in the power trace

HTC G1 (or Magic), Android 1.1

Page 8: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Timestamped events from the phone must be aligned with the

appropriate sample points

Page 9: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

The synchronization information is embedded in power trace

Dimmed screen

Bright screen

HTC G1 (or Magic), Android 1.1

Page 10: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Hypothesise matching pulses

HTC G1 (or Magic), Android 1.1

Page 11: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Find alignment from autocorrelation with a hypothesised signal

HTC G1 (or Magic), Android 1.1

Page 12: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

ARP probing wastes a lotof energy

HTC G1 (or Magic), Android 1.1

Page 13: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Remove the DHCP overhead by using static addressing

HTC G1 (or Magic), Android 1.1

Page 14: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Static addressing reduces the connection cost to 1.5 Joules

Dynamic AddressingStatic Addressing

HTC G1 (or Magic), Android 1.1, Static = 143 trials, Dynamic = 194 trials

Page 15: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

We could remove the ARP probes from our client implementation

RFC2131 “...the client SHOULD probe the newly received address, e.g., with ARP.”

RFC2119 – SHOULD “...there may exist valid reasons in particular circumstances to ignore a particular item”

Page 16: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Android 2.1 doesn't ARP probe in our tests

Google N1, Android 2.1

Page 17: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Dynamic addressing now costs 1.5JDynamic Addressing

G1Dynamic Addressing

N1

Google N1, Android 2.1, 100 trials / HTC G1 (or Magic), Android 1.1, 194 trials

Page 18: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

How much energy is 5 Joules?

● 5 seconds of talk time● 8 minutes of standby time ● 3.5 minutes of idle wireless (the extra cost of

having the wireless on is approx. 0.024W)

Page 19: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Knowing the connection cost helps with system design

● How long should the wireless stay active whilst idle?● 6J connection → 250 seconds idle cost● 1.5J connection → 62 seconds idle cost

● Is it worth forcing programmers to tell the system explicitly?

Page 20: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

The distribution for the G1 phone splits into 3 parts

Dynamic AddressingG1

Dynamic AddressingN1

Google N1, Android 2.1, 100 trials / HTC G1 (or Magic), Android 1.1, 194 trials

Page 21: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

The G1 histogram peaks are due to discontinuities in connection time

HTC G1 (or Magic), Android 1.1, Dynamic

Page 22: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Caused by power control in radio?

HTC G1 (or Magic), Android 1.1, Dynamic

Page 23: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

This power control is evident when sending data too

Send 7K of data over TCP Send 8K of data over TCP

HTC G1 (or Magic), Android 1.1

Page 24: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

This effect has a big impact on energy cost

HTC G1 (or Magic), Android 1.1, 1120 Trials (HTC Hero, Android 1.5 is the same)

Best case ≈ 0.005 Joules

Worst case ≈ 0.13 Joules

Page 25: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

N1 energy performance

Google N1, Android 2.1, 900 Trials

Best case: same Worst case: much better

Best case ≈ 0.005 Joules

Worst case ≈ 0.04 Joules

Page 26: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Programmer should make a different choice depending on the platform

● Using a G1 => send 7k chunks● Using a Nexus One => the larger the better● We see unexpected behaviour in both graphs

Page 27: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Measure sending costs by sending UDP packets

Nexus OneSend 4 packets384ms intervalAndroid 2.2

Page 28: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Nexus OneSend 4 packets224ms intervalAndroid 2.2

Measure sending costs by sending UDP packets

Page 29: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Nexus OneSend 4 packets128ms intervalAndroid 2.2

Measure sending costs by sending UDP packets

Page 30: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Nexus OneSend 4 packets8ms intervalAndroid 2.2

Measure sending costs by sending UDP packets

Page 31: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage
Page 32: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Co-scheduling packets between applications would save energy

● (Some) Applications already wait for opportunistic use of the network

● Operating system / library support needed to do better

Page 33: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

TCP additionally needs to receive packets – more complex

DTIM=1 DTIM=10

Page 34: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Its not clear whether its worth the effort to apply these optimisations

● Wifi connection – should we change the API to get more detail of an application's intent?

● Sending data – should we change the operating system to support packet level co-scheduling?

● Changes to API are costly● To implement● To migrate existing applications

Page 35: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

PhD work by Daniel Wagner

We are attempting to

build a substantive dataset of

smart-phone use

Page 36: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

We collect everything we could think of

Handset: on/off, OS version, device typeScreen: on/off, brightness

Storage: size/free/typeTelephony: ringer/mode/roaming/sigstrength/data

Tel events: calls/text/mms/data Battery: charging/voltage/level

Wifi: connects/scans/dataBluetooth: connects/scans/data

Apps: source/running/resource use

Some of these require polling

Page 37: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

More features coming over the summer

Historical usage graphs and analysisComparison to rest of dataset

Badges (Four-square)Recommend a mobile contract

So start collecting data now to populate your graphs...

Page 38: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

We remove direct identifiers from trace

● Your contacts each get a unique pseudonym● This doesn't give you anonymity● You can assign a readable name for your use● We will only release data which is at least 3

months old → you can opt out retroactively● Pause functionality available

Page 39: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Current progress (5-Jun-2011)

● 855 devices have been activated and submitted data

● 1386 installations were not activated● 20 devices have opted out● Contributions from 78 countries● Africa (11), Asia (136), Europe (314), North

America (213), Oceania (15), South America (31)

Page 40: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Implementation lessons... timestamps are not reliable

● Users manually change the time● Travelling, daylight saving

● Sometimes the OS reports invalid dates● e.g. after an update for some reason

● How do network corrections get applied?● Solution: record phone uptime and insert real-

time clock events to anchor it

Page 41: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Please install Device Analyzerand/or

Please tell us if you have concerns

http://deviceanalyzer.cl.cam.ac.uk

Or search for Device Analyzer by dtg-android on the Android Market

Page 42: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Thanks toAndy Hopper, Alastair Beresford

Simon Hay, Daniel WagnerGoogle & Qualcomm

Computing for the Future of the Planethttp://www.cl.cam.ac.uk/research/dtg/planet

Page 43: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

2G consumes more idle power than 3G (in my office)

HTC G1 (or Magic) running Android 1.1

Page 44: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

Bluetooth power consumption also shows this 'tail energy' effect

Assume that you want to make a connection to a known device

It has to listen periodically for you attempting to contact it

More frequent listening => quicker connection but more power

Page 45: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

18 window+18 interval

18 window+32 interval

Page 46: Interpreting the significance of Android energy ...acr31/talks/rice-deviceanalyzer.pdf · Interpreting the significance of Android energy optimisation by collecting large-scale usage

We can model fit these two modes as expected