Serving Photos at Scaaale : Caching and Storage An Analysis of - - PowerPoint PPT Presentation

serving photos at scaaale
SMART_READER_LITE
LIVE PREVIEW

Serving Photos at Scaaale : Caching and Storage An Analysis of - - PowerPoint PPT Presentation

Serving Photos at Scaaale : Caching and Storage An Analysis of Facebook Photo Caching. Huang et al. Finding a Needle in a Haystack. Beaver et al. Vlad Niculae for CS6410 Most slides from Qi Huang (SOSP 2013) and Peter Vajgel (OSDI 2010) Dynamic


slide-1
SLIDE 1

Serving Photos at Scaaale: Caching and Storage

An Analysis of Facebook Photo Caching. Huang et al. Finding a Needle in a Haystack. Beaver et al. Vlad Niculae for CS6410 Most slides from Qi Huang (SOSP 2013) and Peter Vajgel (OSDI 2010)

slide-2
SLIDE 2
slide-3
SLIDE 3

Dynamic (hard to cache; TAO) Static (photos, normally easy to cache)

slide-4
SLIDE 4

Dynamic (hard to cache; TAO) Static (photos, normally easy to cache)

slide-5
SLIDE 5

Dynamic (hard to cache; TAO) Static (photos, normally easy to cache)

CDN

slide-6
SLIDE 6

Qi Huang, Ken Birman, Robbert van Renesse (Cornell), Wyatt Lloyd (Princeton, Facebook), Sanjeev Kumar, Harry C. Li (Facebook)

An Analysis of Facebook Photo Caching

slide-7
SLIDE 7

Dynamic (hard to cache; TAO) Static (photos, normally easy to cache) “Normal” site CDN hitrate ~99%

CDN

slide-8
SLIDE 8

Dynamic (hard to cache; TAO) Static (photos, normally easy to cache) “Normal” site CDN hitrate ~99% For Facebook, CDN hitrate ~80%

CDN

slide-9
SLIDE 9

Cache Layers Storage Backend

slide-10
SLIDE 10

Facebook Edge Cache Datacenter

Browser Cache

Client Akamai

Origin Cache Backend

Cache layers

slide-11
SLIDE 11

Facebook Edge Cache Datacenter

Browser Cache

Client Akamai

Origin Cache Backend

Cache layers (no access)

slide-12
SLIDE 12

Facebook Edge Cache Datacenter

Browser Cache

Client

Origin Cache Backend

Cache layers Points of presence: Independent FIFO Main goal: reduce bandwidth

slide-13
SLIDE 13

Facebook Edge Cache Datacenter

Browser Cache

Client

Origin Cache Backend

Cache layers Origin: Coordinated FIFO Main goal: traffic sheltering

slide-14
SLIDE 14

Facebook Edge Cache Datacenter

Browser Cache

Client

Origin Cache Backend

Cache layers Origin: Coordinated. FIFO Main goal: traffic sheltering

hash

slide-15
SLIDE 15

Facebook Edge Cache Datacenter

Browser Cache

Client

Origin Cache Backend

Cache layers

Analyze traffic in production!

Instrument client JS Log successful requests. Correlate across layers.

slide-16
SLIDE 16

Sampling on Power-law

Object-based

18

Object rank

  • Object-based: fair coverage of unpopular content
  • Sample 1.4M photos, 2.6M photo objects
slide-17
SLIDE 17

Data analysis

slide-18
SLIDE 18

77.2M 26.6M 11.2M 7.6M

Backend (Haystack) Browser Cache Edge Cache Origin Cache

PoP Client Data Center

65.5% 58.0% 31.8%

R

Traffic Share 65.5% 20.0% 4.6% 9.9%

21

slide-19
SLIDE 19

22

Object rank

slide-20
SLIDE 20

Popularity Distribution

  • Backend resembles a stretched exponential dist.

23

slide-21
SLIDE 21

Popularity Impact on Caches

  • Backend serves the tail

24

70% Haystack

slide-22
SLIDE 22

10 20 30 40 50 60 70 80 90 100 A B C D E F G

Hit rates for each level (fig 4c)

Browser Edge Origin

slide-23
SLIDE 23

What if?

slide-24
SLIDE 24

Edge Cache with Different Sizes

  • “Infinite” size ratio needs 45x of current capacity

Infinite Cache 65% 68% 59%

29

  • Picked San Jose edge (high traffic, median hit ratio)
slide-25
SLIDE 25

Edge Cache with Different Algos

  • Both LRU and LFU outperform FIFO slightly

Infinite Cache

30

slide-26
SLIDE 26

S4LRU

Cache Space More Recent L3 L2 L1 L0

31

slide-27
SLIDE 27

Edge Cache with Different Algos

  • S4LRU improves the most

68% 1/3x Infinite Cache

35

59%

slide-28
SLIDE 28

Edge Cache with Different Algos

  • Clairvoyant => room for algorithmic improvement.

Infinite Cache

36

slide-29
SLIDE 29

Origin Cache

  • S4LRU improves Origin more than Edge

14% Infinite Cache

37

slide-30
SLIDE 30

Geographic Coverage of Edge

Small working set

38

slide-31
SLIDE 31

Geographic Coverage of Edge

39

Atlanta 20% local 5% Dallas 35% D.C. 5% NYC 20% Miami 5% California 10% Chicago

  • Atlanta has 80% requests served by remote Edges. Not uncommon!
slide-32
SLIDE 32

Geographic Coverage of Edge

Amplified working set

40

slide-33
SLIDE 33

Collaborative Edge

41

slide-34
SLIDE 34

Collaborative Edge

  • “Collaborative” Edge increases hit ratio by 18%

18%

42

Collaborative

slide-35
SLIDE 35
slide-36
SLIDE 36
slide-37
SLIDE 37
slide-38
SLIDE 38

What Facebook Could Do:

  • Improve cache algorithm (+invest in cache algo research)
  • Coordinate Edge caches
  • Let some phones resize their own photos
  • Use more machine learning at this layer!
slide-39
SLIDE 39
slide-40
SLIDE 40

Backend storage for blobs

  • Some requests are bound to miss the caches.
  • Reads >> writes >> deletes.
  • Writes often come in batches (Photo Albums)
  • In this regime, Facebook found default solutions not to work.
slide-41
SLIDE 41
slide-42
SLIDE 42
slide-43
SLIDE 43
slide-44
SLIDE 44
slide-45
SLIDE 45
slide-46
SLIDE 46
slide-47
SLIDE 47
slide-48
SLIDE 48
slide-49
SLIDE 49