a day in the life of a facebook photo€¦ · front-end http post thrift http post resize &...
TRANSCRIPT
![Page 1: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/1.jpg)
![Page 2: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/2.jpg)
A Day in the Life ofa Facebook Photo
Brian CabralDirector of Engineering
![Page 3: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/3.jpg)
2 Billionphotos shared daily
daily users
968 million
![Page 4: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/4.jpg)
100s of different devices
1,000s of locales/connection types
![Page 5: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/5.jpg)
Massive distributed system
Requiring on-the-fly resizing and transcoding
![Page 6: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/6.jpg)
Basic architecturePhoto Upload
Everstore
PHP Front-end
HTTP post
Thrift
HTTP post
Resize &
Transcode
![Page 7: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/7.jpg)
Resizing
On upload we target 960 or 2048 • function of input size & expected output resolutions
Custom resizing reconstruction filter • Type of separable Lanzcos filter • Designed for speed & quality
Resizing re-transcode
![Page 8: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/8.jpg)
Transcoding
We use PJPEG with custom tables
Extensive internal analysis showed that for most images PJPEG was hard to beat
![Page 9: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/9.jpg)
Everstore
NFS
Fil
er
Ch
eap
FS
Hay
stac
k
HD
FS-
Bas
ed
Exte
rnal
Ven
do
r?
Mechanic+Controller
Photo LB
Photo upload
Video LB
Video upload
Video encode
Verifieddownloads
AkamaiCDN
Download LB
Edge Cache
Origin Cache
Imageprocessing
(FB Algo)Router
Photo product(on www)
URL Generation
Everstore API
![Page 10: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/10.jpg)
Basic architecturePhoto Download
OriginCache
Edge
Resize &Transcode
FCDN
Everstore
HTTP get Thrift
![Page 11: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/11.jpg)
CDN CachingHaystack:
Distributed File Store
Proxygen: Layer 7
Balancer
BigCache: RAM + Flash
Cache Akamai
Facebook Data Centers
Edge Network dozens of PoPs around the world
Proxygen: Layer 7
Balancer
BigCache: RAM + Flash
Cache
![Page 12: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/12.jpg)
System design & development
Continuous design & developmentControlled rolloutsExtensive instrumentation
• Big spec, design, … waterfall • Extensive QA testing
![Page 13: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/13.jpg)
Open questions
Can we do better than PJEG?
Can we eliminate intermediate processing?
Is there a way to arbitrarily deliver
different sizes and quality?
Can we use image specific caching
schemes?
Can we use ML to dynamically load
adapt?How do GPUs and CPUs aggregate in the
“large?”
![Page 14: A Day in the Life of a Facebook Photo€¦ · Front-end HTTP post Thrift HTTP post Resize & Transcode. Resizing ... Facebook Data Centers Edge Network dozens of PoPs around the world](https://reader035.vdocuments.mx/reader035/viewer/2022070906/5f7871dd38f63e6b6851e8ae/html5/thumbnails/14.jpg)