• No results found

MAUI: Dynamically Splitting Apps Between the Smartphone and Cloud

N/A
N/A
Protected

Academic year: 2021

Share "MAUI: Dynamically Splitting Apps Between the Smartphone and Cloud"

Copied!
23
0
0

Loading.... (view fulltext now)

Full text

(1)

MAUI: Dynamically Splitting Apps Between the Smartphone and Cloud

Brad Karp

UCL Computer Science

CS M038 / GZ06 28th February 2012

(2)

Limited Smartphone Battery

Capacity

•  iPhone 4 battery: 1420 mAh (@ 3.7 V)

•  Idle state (backlight off) power costs for

Openmoko Neo Freerunner smartphone: (note 2.5G radio) Total power: 268.8 mW, i.e., 19 hours in idle mode on iPhone 4

(3)

Smartphone Backlight Power

Consumption

(4)

Smartphone CPU and RAM Power

Consumption

•  Subset of SPEC benchmarks at two clock

rates

[Carroll, Heiser,

(5)

Smartphone WiFi and 2.5G Power

Consumption

•  15 MB wget download for WiFi

[Carroll, Heiser,

(6)

Smartphone WiFi and 2.5G Power

Consumption

•  15 MB wget download for WiFi

[Carroll, Heiser,

USENIX ATC 2010]

Radio power consumption dwarfs CPU power consumption: ca. 700 mW for WiFi vs. ca. 180 mW for worst-case CPU load

(7)

Central Idea: Offload Computation

from Phone to Cloud

•  Battery capacity on phones constraining

(technology trends suggest will remain so) •  Phone compute resources limited (RAM,

CPU, secondary storage)

•  Cloud servers better provisioned

•  Goals:

– Save energy on phone overall

– Improve (or do not reduce) app performance

(8)

Central Idea: Offload Computation

from Phone to Cloud

•  Battery capacity on phones constraining

(technology trends suggest will remain so) •  Phone compute resources limited (RAM,

CPU, secondary storage)

•  Cloud servers better provisioned

•  Goals:

– Save energy on phone overall

– Improve (or do not reduce) app performance

for user

Central trade-off: offloading computation to cloud may save CPU energy on phone, but sending current state of app to cloud costs radio energy on phone

(9)

Energy Consumption for Code

Upload: 3G vs. WiFi

[HTC Fuze, 1340 mAh battery]

(10)

Energy Consumption for Code

Upload: 3G vs. WiFi

[HTC Fuze, 1340 mAh battery]

Network RTT plays significant role in power consumption; TCP’s throughput inversely proportional to RTT

Energy consumed roughly linear in RTT (see Fig. 2)

(11)

When Would Code Offload

Save Energy?

•  When state to transfer to cloud is small

•  When CPU load for offloaded code is

heavy

•  When WiFi connectivity available with low

(12)
(13)

Offloading Code in MAUI

•  CPU-independence provided by .NET

Common Language Runtime (CLR)

•  Smartphone can send app code to server or

code’s hash to server (if code available from another server)

•  Programmer marks methods that can be

offloaded “[Remoteable]” in C# source code

–  Default: local on phone only

–  Avoid running UI code on server

(14)

Offloading Code in MAUI

•  CPU-independence provided by .NET

Common Language Runtime (CLR)

•  Smartphone can send app code to server or

code’s hash to server (if code available from another server)

•  Programmer marks methods that can be

offloaded “[Remoteable]” in C# source code

–  Default: local on phone only

–  Avoid running UI code on server

–  Avoid I/O with phone devices on server

.NET supports serializing data into XML

MAUI phone sends serialized state over network to server

(15)

Partitioning: Passing State

Between Phone and Server

•  Server will need all memory contents used

by offloaded method

•  No globals in C#, but public static member

variables accessible by all methods •  State includes:

– method parameters

– all object’s member variables

– “deep copy” of all heap-allocated data

(16)

Handling Server Failures

•  Phone enforces timeout on return of

results by method invoked on server

•  After timeout, phone may invoke method

locally, or retry on other cloud server

•  Risk: multiple executions of method on

server(s)

•  Hence, no side-effects outside app

(17)

Estimating Size of State Transfers

(18)

Optimizing Energy Use:

Annotated Call Graph

•  Vertices: method’s computational and energy

(19)

Optimizing Energy Use:

Annotated Call Graph

•  Vertices: method’s computational and energy

costs

Insight: may be more power-efficient to offload

multiple methods than one method

Reason: want phone-cloud crossings to occur at edges of call graph with small state transfer

(20)

End-to-End Energy Savings:

Ideal Application

(21)

End-to-End Energy Savings:

Other Applications

(22)

Offloaded Method Execution

Performance

•  Note latency measurements only for

offloaded methods!

•  For face recognition, nearly all work is in

offloaded methods, so virtually end-to-end

(23)

MAUI: For Discussion

•  Goal is to minimize code modifications

–  But code refactoring may improve performance

–  Example: don’t invoke server-side method 60

times/frame; invoke “wrapper” once/frame

•  What is energy cost of profiling itself?

•  Current system doesn’t support

multi-threaded apps

–  If two threads share state, wouldn’t want to

offload one and run one locally

References

Related documents

The first step we utilized to solve this problem is to build an image classifier to differentiate between benign and malignant, calcifications and masses found

This thesis presents an idea to integrate Internet of Things (IoT) devices via a blockchain based decentralize application based on Ethereum.The application consists of

For example for F ( ) = ( ) that is the cumulative distribution of a standard normal we have the standard probit model.. First all of the three WM-estimators have …nite sample

To address this, the JISC Usage Statistics Review Project aims to formulate a fundamental scheme for recording usage data and to propose a standard for its aggregation to

Two rationales offered for policymakers’ focus on core measures of inflation as a guide to underlying inflation are that core inflation omits food and energy prices, which are

Office of the Civil Service Commission ( ( OCSC OCSC )

• Experience in developing naturalist education programs, California native plant propagation and community based restorations within the non-profit sector.. • Cris joined the