Top Banner
Informed Mobile Prefetching T.J. Giuli Christopher Peplin David Watson †‡ Brett Higgins Jason Flinn Brian Noble
26

Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Dec 31, 2015

Download

Documents

Agnes Thomas
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: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Informed Mobile Prefetching

T.J. Giuli†

Christopher Peplin†

David Watson†‡

Brett HigginsJason Flinn Brian Noble

† ‡

Page 2: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 2

Prefetching + Mobile Networks

Time, distance

$#&*!!

Phone activity

Read article

Phone activity

Slow fetch

PrefetchArticle loads instantly

Sleeping

Page 3: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 3

A Tale of Two Apps

The Data Hog The Data Miser

Page 4: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 4

A Tale of Two Apps

• Four hours later:• Battery died hours ago• Fetch time: INF

• Four hours later:• Battery: 10%• Fetch time: many seconds

Scenario:50% battery

4 hours until recharge

We must conserve energy!(…no big surprise there.)

Page 5: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 5

A Tale of Two Apps

• One hour later:• Battery: 5% (charging)• Fetch time: << 1 second

• One hour later:• Battery: 40% (charging)• Fetch time: many seconds

Scenario:50% battery

1 hour until recharge

It’s okay to spend resources……if it will benefit the user.

(And if we can spare the resources.)

Page 6: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 6

One more scenario: Reality

• The only scenario that matters• Network conditions change rapidly• User/app behavior changes too

• No one strategy is always best• Even for two scenarios

• Mobile prefetching is complex.• Must consider:

• Network availability/quality• Network energy cost model• Overall resource spending• Time until resource replenishment• Observed usefulness of prefetching…

• But the benefits could be great!

Page 7: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 7

So, who should deal with it?• Users?

• Monitor resources, networks• Adjust behavior• Fiddle with app settings

• Developers?• Monitor resources, networks• Observe user behavior• Adjust prefetch strategy

Page 8: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 8

Informed Mobile Prefetching

• System support for prefetching on mobile networks• Applications specify hints• What & how to prefetch

• System decides when to prefetch• Monitors network availability and quality• Tracks resource spending over time• Adjusts the importance of energy/data conservation• Tracks how often the user consumes hinted data

Page 9: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 9

Roadmap

• Motivation• IMP Design & Implementation• Interface• Prefetch decision algorithm

• Applications & Evaluation• Summary

Page 10: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 10

IMP Interface

• App passes a Fetcher• Callback to fetch data• Size of data item• Optional prefetch class

• IMP returns a Future• Handle for future access• get() invokes app fetch

• Intentional Networking• Simple use of multiple networks• Prioritize FG traffic over

prefetches

Application

IMP

Intentional Networking

prefetch()get()

fetch()

Page 11: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 11

How to decide when to prefetch?

• Core: cost/benefit analysis• Inspired by TIP (SOSP ‘95)

• Benefit: time savings• Cost: energy, cellular data• Prefetch when:• Benefit > cost

• How to calculate?• How to compare?

HintsIMP

BenefitCost

Page 12: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 12

How to decide when to prefetch?

• Network measurements• Bandwidth, RTT, availability

• Benefit = future fetch time• Cost = energy + data• PowerTutor power model

(CODES+ISSS ‘10)• (Current cost) – (future cost)

• Future depends on user• How often is data used?

HintsIMP

BenefitCost

Observations:Bandwidth

RTTPower state

Page 13: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 13

How to decide when to prefetch?

• API lets us track accuracy• Fraction of hinted data used• “Used” = get()• “Not used” = cancel()

• Use accuracy in calculations• e.g. benefit = time × accuracy

• Per-class accuracy estimate• If app specifies classes

HintsIMP

BenefitCost

Observations:Bandwidth

RTTPower state

Accuracy of prefetch

hints

Page 14: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 14

How to decide when to prefetch?

• Budgeted resources• Fixed, replenishable capacity• Time period to spend

• Approach: Price is Right™• Spend close to budget• But not over budget!

• Goal-directed adaptation• Odyssey (TOCS ‘04)• Measure resource spending• Adjust resource importance

HintsIMP

BenefitCost

UserTime

Energy,Data

Observations:Bandwidth

RTTPower state

Accuracy of prefetch

hints

Page 15: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 15

How to decide when to prefetch?

• Re-evaluation• Outcome may change later

• Network conditions change• Resource spending slows

• Periodically re-run analysis

• Batching• Can amortize tail energy cost• Evaluate all batch sizes• Prefetch when benefit > cost

• For any batch size

HintsIMP

BenefitCost

UserTime

Energy,Data

Observations:Bandwidth

RTTPower state

Accuracy of prefetch

hints

New batch,or wait a bit

Page 16: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 16

Roadmap

• Motivation• IMP Design & Implementation• Interface• Prefetch decision algorithm

• Applications & Evaluation• Summary

Page 17: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 17

Applications

• K9 email client• Popular Android email client• Supported transparently via IMP-aware IMAP proxy• Default: prefetch emails over 32KB

• OpenIntents News Reader• Open-source Android Atom/RSS feed reader• Added IMP support code• Default: no article text/media prefetching (summary only)

Page 18: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 18

Evaluation: Methodology

• Gathered network trace in a moving vehicle• Sprint 3G & open WiFi• BW up/down, RTT

• Replayed in lab (trace map

here)

Page 19: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 19

Evaluation: Comparison Strategies

• Never prefetch• Prefetch items under a size threshold• App-specific threshold value

• Prefetch only over WiFi• Always prefetch

• Common heuristics; simple to implement

Page 20: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 20

Evaluation Results: Email

Page 21: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 21

Evaluation Results: Email

• All resource goals met• Much smaller fetch time• Within 300ms of “always”• 2-8x less than others

• Walking trace on campus• Similar results

Page 22: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 22

Evaluation Results: News

Page 23: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 23

Evaluation Results: News

• All resource goals met• Smaller fetch time

• Whenever other strategies meet the goals

• Walking trace on campus• Similar results*

* …with one exception.

Page 24: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 24

Evaluation Results: News

Page 25: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 25

Evaluation Results: News

• Effect of prefetch classes• Lower average fetch time• Meet goals more reliably

• Small developer effort• Significant improvement

Page 26: Informed Mobile Prefetching T.J. Giuli † Christopher Peplin † David Watson †‡ Brett Higgins Jason Flinn Brian Noble †‡

Brett Higgins 26

Summary

• Informed Mobile Prefetching• App supplies prefetch hints• System decides when to prefetch• Manages budgeted resources

• “Price is Right” approach

• Tracks prefetch accuracy• Avoids wasteful prefetching

• Meets all resource goals• Improves average fetch time in most cases

• Compared to simple strategies that meet same goals