Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance*...

42
Caching Doesn’t Improve Mobile Web Performance * Jamshed Vesuna Colin Scott Michael Buettner Δ Michael Piatek Δ Arvind Krishnamurthy * Scott Shenker †‡ UC Berkeley Δ Google * University of Washington ICSI Special thanks to our shepherd Dan Tsafrir * Much

Transcript of Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance*...

Page 1: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott†

Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy* Scott Shenker†‡

†UC Berkeley ΔGoogle *University of Washington ‡ICSI

Special thanks to our shepherd Dan Tsafrir*Much

Page 2: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Flywheel NSDI’15 Results

Increasing the cache hit ratio of their proxy from 22% to 32% resulted in only 1-2% reduction in median mobile page load time

2

Page 3: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

3

Page 4: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Goal:

Understand the effects of caching on mobile web performance

4

Page 5: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Outline

● Motivation● Background● Model (Estimating Page Load Time)● Methodology for empirical results● Corroborating model with empirical results● Conclusion

5

Page 6: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Background - Loading a Web Page

6

Page 7: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Background - Critical Path

7

Critical Path: the longest chain of dependent browser tasksFetch Delay = Network Delay

Render Delay = Computational Delay

Page 8: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Background - Page Load Time (PLT)

8

Page 9: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Outline

● Motivation● Background● Model (Estimating Page Load Time)● Methodology for empirical results● Corroborating model with empirical results● Conclusion

9

Page 10: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Performance Model - Estimating PLT

C - computational delaysN - network delaysK - fraction of objects on the critical path that are cacheableX - cache hit ratio (out of all objects)f() - overlap of C and N on the critical path

EPLT [X] = C+N·(1−K·X)− f(X)

10

Page 11: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Performance Model - Building an Intuition

● Cold cache (X = 0):○ Original Page Load Time = C + N

● Perfect cache for a “perfectly cacheable page”○ X = 1, K = 1 ○ Strict upper bound on improved page load time:

■ EPLT [1] = C

EPLT [X] = C+N·(1−K·X)

11

Page 12: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Performance Model - Fitting K

In practice, K ~ 0.2 = ⅕*

EPLT [max] ≤ C + ⅘N

*Demystifying Page Load Performance with WProf. NSDI ’13 12

Page 13: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Prediction: Upper Bound on Caching Benefits

C:N ~ ⅔ for mobile devices

PLTo = EPLT [0] ≤ C+N = 5/2 C EPLT [max] ≤ 11/5 C

Reduction in PLT: (EPLT [X] - PLTo) / PLTo

≤ 3/25 (12% with a perfect cache!)

13

Page 14: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

C:N ~ ⅙ for fast desktop devices

PLTo = EPLT [0] ≤ C+N = 7 C EPLT [max] ≤ 21/5 C

Reduction in PLT: (EPLT [X] - PLTo) / PLTo

≤ 2/5 (40% with a perfect cache!)

14

Prediction: Desktop Benefits from Caching

Page 15: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Explanation: C is Small for DesktopC:N ~ ⅕ for 2GHz CPU*

*Demystifying Page Load Performance with WProf. NSDI ’13

Page 16: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Explanation: C is Small for DesktopC:N ~ ⅕ for 2GHz CPU*

*Demystifying Page Load Performance with WProf. NSDI ’13

Page 17: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

C:N ~ ⅕ for 2GHz CPU*

Explanation: C is Small for Desktop

*Demystifying Page Load Performance with WProf. NSDI ’13

Page 18: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

C:N ~ ⅕ for 2GHz CPU*

Explanation: C is Small for Desktop

*Demystifying Page Load Performance with WProf. NSDI ’13

Page 19: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

19

C:N ~ ⅔ for 1GHz CPU

Explanation: C is Larger for Mobile

Page 20: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Outline

● Motivation● Background● Model (Estimating Page Load Time)● Methodology for empirical results● Corroborating model with empirical results● Conclusion

20

Page 21: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Measurement Methodology

21

Page 22: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Measurement Methodology

22

Page 23: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Measurement Methodology

23

1. Record the original page

Page 24: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Measurement Methodology

24

1. Record the original page

Page 25: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Measurement Methodology

25

1. Record the original page2. Then, replay with:

a. With a “perfect cache”b. Or a “partial cache”

Page 26: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Measurement Methodology

26

1. Record the original page2. Then, replay with:

a. With a “perfect cache”b. Or a “partial cache”

3. Repeat

Page 27: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Outline

● Motivation● Background● Model (Estimating Page Load Time)● Methodology for empirical results● Corroborating model with empirical results● Conclusion

27

Page 28: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Workload Characteristics

28

Page 29: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Workload Characteristics

29

Page 30: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Workload Characteristics

30

Page 31: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Increasing Cache Hits - Flywheel Result

Increased cache hit ratio from 20% to 30%→ 1-2% reduction in page load time 31

Page 32: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Desktop vs Mobile, Perfect Cache

32

Reduction Defined As: (Original PLT - PLT with a perfect cache) / (Original PLT)

Page 33: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Desktop vs Mobile, Perfect Cache

33

Median reduction in PLT for 3.2 GHz desktop is 34%

Page 34: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Desktop vs Mobile, Perfect Cache

Median reduction in PLT for mobile is 13%34

Page 35: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Isolating the Bottleneck Resource

35

Constrained CPU similar to Mobile

Page 36: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Isolating the Bottleneck Resource

36

Constrained RAM similar to Desktop

Page 37: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Isolating the Bottleneck Resource

CPU is the key difference, not RAM37

Page 38: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Slower CPUs Show Reduced Improvements

As CPU is throttled, caching has a reduced impact on PLT 38

Page 39: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Slower CPUs Show Reduced Improvements

As CPU is throttled, caching has a reduced impact on PLT 39

Page 40: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Caching Benefits are Limited by Slow CPUs

● We know: slower CPUs increase computational delays (C)● For desktop, network delay (N) dominates (C)● For mobile*, network delay (N) is comparable to (C) (3:2)

*Assumption: “All else being equal” (including b/w) 40

● Caching only reduces (N)

→ Mobile devices benefit less from web caching

Page 41: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Implications

● Content providers:○ Stop paying for CDNs* [for mobile users]

*If you only care about end user latency

● Analyze what’s on the critical path○ Cache critical path items○ Make use of SPDY or HTTP/2 prioritization levels

41

Page 42: Mobile Web Performance Caching Doesn’t Improve...Caching Doesn’t Improve Mobile Web Performance* Jamshed Vesuna† Colin Scott† Michael BuettnerΔ Michael PiatekΔ Arvind Krishnamurthy*

Conclusion

[email protected] [email protected]

This Presentation: https://goo.gl/plH4HE PLT Analysis: https://github.com/colin-scott/page_load_timeOpen Source Tools: https://github.com/JamshedVesuna/telemetry

42

● Caching doesn’t decrease mobile PLT much○ Items on the critical path are often not cacheable*○ CPU is the key bottleneck resource on mobile

● Key contribution: predictive performance model

*Demystifying Page Load Performance with WProf. NSDI ’13