+ All Categories
Home > Documents > Timecard : Controlling User-Perceived Delays in Server-Based Mobile Applications

Timecard : Controlling User-Perceived Delays in Server-Based Mobile Applications

Date post: 23-Feb-2016
Category:
Upload: alda
View: 40 times
Download: 0 times
Share this document with a friend
Description:
Timecard : Controlling User-Perceived Delays in Server-Based Mobile Applications. Lenin Ravindranath, Jitu Padhye, Ratul Mahajan, Hari Balakrishnan. Cloud Services. Mobile Apps. Response Time Matters. Cloud Services. Users are impatient - PowerPoint PPT Presentation
Popular Tags:
29
Timecard: Controlling User-Perceived Delays in Server-Based Mobile Applications Lenin Ravindranath, Jitu Padhye, Ratul Mahajan, Hari Balakrishnan
Transcript
Page 1: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

Timecard:Controlling User-Perceived Delays in

Server-Based Mobile Applications

Lenin Ravindranath, Jitu Padhye, Ratul Mahajan, Hari Balakrishnan

Page 2: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

CloudServices

MobileApps

Page 3: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

CloudServices

• Users are impatient– 100ms delay can cost substantial drop in revenue at Amazon– Similar observations from Google and Bing

Response Time Matters

Page 4: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

Control Variability in Response Times

Request Response

• Fixed deadlines• Trade-off quality for response time– More time to compute, better quality results– Flexible Services

• For e.g., search

Deadline

Server processing

Page 5: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

The elephant is outside the room

Request Response

Server processing

Page 6: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

The elephant is outside the room

User click

Server processing

App App

ServerRequest Response

Reading sensors Link quality(3G, HSPA+, LTE, Wifi)

Response size

Phone model

Parsing andRendering

Uplink Downlink

User perceived delay

Highly variable

Radio State

Page 7: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

The elephant is outside the room

User click

Server processing

App App

ServerRequest Response

Reading sensors Link quality(3G, HSPA+, LTE, Wifi)

Response size

Phone model

Parsing andRendering

Uplink Downlink

User perceived delay

Highly variable

Radio State

• Unaware of end-to-end delays• Clients with non-trivial external delays– Poor end-to-end response times

• Client with low external delays– Do not produce the best quality result

Page 8: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

The elephant is outside the room

User click

Server processing

App App

ServerRequest Response

Reading sensors Link quality(3G, HSPA+, LTE, Wifi)

Response size

Phone model

Parsing andRendering

Uplink Downlink

User perceived delay

Highly variable

Radio State

Servers should adapt to external delays and control end-to-end delay variability

Page 9: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

TimecardGetElapsedTime(); PredictRemainingTime

(responseSize);

Time elapsed since user request

Predicted downlink + app processing delay

App App

Server

Page 10: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

Timecard

App App

Server

Desired end-to-end delay

App

GetElapsedTime(); PredictRemainingTime(responseSize);

Adapt Processing Time

Page 11: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

Timecard

App

Server

Desired end-to-end delay

AppApp

GetElapsedTime(); PredictRemainingTime(responseSize);

Adapt Response

Page 12: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

Timecard

App

Server

Desired end-to-end delay

App

GetElapsedTime(); PredictRemainingTime(responseSize);

Page 13: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

TimecardGetElapsedTime(); PredictRemainingTime

(responseSize);

App App

Server

Page 14: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

UI Thread

Background Thread

Background Thread

Server Threads

UI dispatcher

Thread start

GPS start

Web requestGPS callback

Event handler

Spawn workersRequest handler

Send response

Web callback

App App

Server

Challenges

Page 15: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

UI Thread

Background Thread

Background ThreadApp App

Server

Challenges

Transaction

GetElapsedTime(); PredictRemainingTime(responseSize);

No single reference clock

Automatically collect data and learn

Page 16: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

• Online Transaction Tracking• Time Synchronization• Remaining Time Predictor– Downlink delay– App processing delay

Timecard

Page 17: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

• Periodic time sync probes from app to server– Find drift and offset between clocks

• Use server clock as reference clock– Client maps local time to server time

Synchronizing Time

• Efficient technique for probing– Aware of the radio state and traffic– Minimal extra delays– Energy efficient

Page 18: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

Predicting Remaining Time

App App

Server

• Downlink time• App processing time

PredictRemainingTime(responseSize);

Page 19: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

Predicting Downlink Time

Data size

• 1 KB to 40 KB of data• RTT matters than throughput– Predict RTT

• TCP window state matters– Multiple RTTs– Estimate TCP Window &

number of RTTs

• Complicated by middleboxes

Middlebox

Read TCP state

EstimateTCP state

Page 20: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

Predicting Downlink Time

Data size

• Model downlink delay– Recent RTT– Bytes already transferred– Response size– Network provider– Client OS

Middlebox EstimateTCP state

• Error in cellular network– median 17 ms– 90th percentile 86ms

Page 21: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

Predicting App Processing Time

• Parsing and rendering depends on data size• Model processing time as a function of– Response data size– Phone model

4.6% (8ms) median error, 10% in 90th percentile

Page 22: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

Timecard Implementation

App App

Server

Transaction Tracking

Transaction Tracking

Logging

Predictor

Time Sync

Data Collection

Automatic Instrumentation• WP Apps• ASP .NET services APIs

Page 23: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

Timecard can help control end-to-end delay

• Modified two services (and two apps) to use timecard

Mobile Ads Service

Page 24: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

• 0.1% runtime overhead

• Less than 1% memory overhead– Garbage collection in idle time

• Less than 1% network overhead

• Negligible battery overhead

Timecard Overhead

Page 25: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

TimecardGetElapsedTime(); PredictRemainingTime

(responseSize);

App App

Server

Desired end-to-end delay

Adapt Processing Time

Adapt Response

Page 26: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

TimecardGetElapsedTime(); PredictRemainingTime

(responseSize);

App App

Server

Request Prioritization

Desired end-to-end delay

Page 27: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

TimecardGetElapsedTime(); PredictRemainingTime

(responseSize);

App App

Server

Adapt Resources Used

Desired end-to-end delay

Page 28: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

Backup

Page 29: Timecard : Controlling User-Perceived Delays in  Server-Based Mobile Applications

UI Thread

Background Thread

Background Thread

Server Threads

App App

Server

Transaction Tracking

TC Transaction Context

- Timestamps, transaction/device/network information

TC

TC

TC

TC

TC

TC

TC

TC

GetTransaction().GetStartTime();


Recommended