SlideShare a Scribd company logo
1 of 31
Download to read offline
Kraken
P2P Docker Image Distribution
Yiran WangEvelyn LiuCody Gibb
Agenda
● Docker image and docker registry internals
● Common ways to speed up docker pull
● P2P solutions
● How Uber solves scale problem with Kraken
● Q&A
What is a docker image
● Image layers
○ Regular tar.gz files
○ Each layer = one line in Dockerfile
○ One special layer - image config
■ Defines ENV, USER, etc.
● Image manifest
○ Regular json file
○ Contains SHA256 digests of layers
● Image tag
○ Key-value pair, human-readable name to manifest SHA
● You can easily construct a docker image by hand!
What is a docker registry
● A simple web server to store and distribute docker images
● Straightforward REST APIs:
GET /v2/
GET /v2/<name>/tags/list
GET, PUT, DELETE /v2/<name>/manifests/<reference>
GET /v2/<name>/blobs/<digest>
POST /v2/<name>/blobs/uploads
GET, PUT, PATCH, DELETE /v2/<name>/blobs/uploads/<uuid>
What is docker pull
● Resolve tag to manifest
● Pull manifest, find layers not available locally
● Pull tar.gz files
● Decompress them
Speed up docker pull
● Make your docker images homogeneous
○ Use a common base image
○ Dockerfile template, multi-stage build
○ Use a build tool that supports distributed layer cache
■ Makisu from Uber, Kaniko from Google, BuildKit from Docker/Moby
Scale Docker Registry
● Profile first
● Start with a layer of Nginx caches
○ Ideal for bursty workloads
○ Works better with connection limits
● Nginx was not enough for Uber
Uber’s Workload
● Large images
○ 1G average, 10G is becoming common
● Batch jobs
○ Concurrent docker pull - O(10k)
■ Cannot use HDFS
● Host maintenance
○ Reshuffle large number of unique images - O(1k)
■ Cannot add more Nginx
● Replication across zones - on-prem + cloud zones
○ More expensive and complex as Uber add more zones
P2P
Design Considerations
● Optimize for data center internal usage
○ We control all peers
● Low maintenance
○ No single point of failure
● Handle bursty load
○ O(10k) of same image
○ O(1k) of unique images
● Care about tail completion time
Layered Structure
● Easy to understand
○ Just a tree (or trees)
● Fat trees not optimal for big blobs
○ Speed limited by number of
branches
● Hard to maintain topology
● e.g. LAD from Facebook
Central Overseer
● Divide blob into small data chunks (4MB)
● One central component makes all
decisions
○ Schedules P2P transmission of each
data chunk for each node
● Optimal in theory, hard to implement
○ Need to support very high QPS
○ Hard to handle node failure and
slowdown
● e.g. Dragonfly from Alibaba
Random Graph
● A central component makes connection
decisions
● Nodes make transfer decisions
● “Random regular graph”
○ Good connectivity, small diameter
○ Jellyfish, NSDI 2012
● Performant
○ ≈ 80% of max speed in simulation
with only one seeder
● Resilient to failures
● Our pick
Kraken
Glossary
● Torrent
○ File broken into multiple pieces, typically 4MB each
○ Pieces transferred independently
● Peer
○ Participant in torrent network
○ Connected peers transfer pieces between each other
○ Peer with 100% of pieces is a seeder
Components
● Agent
○ A peer on every host
○ Implements Docker registry interface
● Origin
○ Dedicated seeders
○ Pluggable storage backend (e.g. S3)
○ Self-healing hash ring
● Tracker
○ Tracks peers and seeders in-memory
○ Self-healing hash ring
Kraken Architecture
Kraken Architecture
Key Features
● Just a caching / distribution layer
○ Should be able to suffer total data loss
and recover
○ All blobs have TTL
● Minimal dependency set
○ DNS
● Content-addressable blobs
○ Blob identifier is hash of blob content
○ Immutable
○ Disadvantage: not user friendly
Kraken Architecture
Peer Discovery
● Tracker returns 50 random peers,
sorted by preference
○ Completed agents (highest)
○ Origins
○ In-progress agents (lowest)
● Agent iterates through the 50 until it
has 10 connections
Blue Origin
Grey Agent
Yellow Agent (downloading)
Green Agent (completed)
Build Index
● Mapping of tag to manifest
SHA256 digest
● No consistency guarantees
○ Client must use unique tags
● Pluggable storage
● Powers image replication
between clusters
○ Simple queue with retry
Kraken Architecture
Global Replication in a Hybrid Cloud Environment
● Kraken cluster in each zone
● Zones in each region share a
storage backend
Security
● Mutual TLS for all communications with central components
○ End to end security
● P2P traffic doesn’t go through TLS (yet)
○ No need to worry about data integrity
Results
Performance in Test
Setup
● 3G image with 2 layers
● 2600 hosts (5200 downloads)
● 0.3GB/s speed limit
● Theoretical max 10s
Result
● P50 10s
● P99 18s
● Max 32sec
○ Outlier (bad host?)
Performance in Production
Blobs distributed per day in busiest zone:
● 1mil 0-100MB blobs
● 600k 100MB-1G blobs
● 100k 1G+ blobs
Peak
● 20k 100MB-1G blobs within 30 sec
○ With old setup, this would’ve caused outage
Optimizations
● Low connection limit
○ Less overhead
● Aggressively disconnect unneeded connections
○ Rebalance network
● Pipelining
○ Maintain a request queue of size n for each connection
○ Less idle time between peers
● Endgame mode
○ For the last few pieces, request from all connected neighbors
Unsuccessful Optimizations
● Prefer peers on the same rack
○ Likely to form a disjoint graph
○ Not needed for over-provisioned network
● Reject incoming connection based on number of mutual connections
○ Haven’t seen issues caused by graph density problems
Takeaways
● Solution not specific to Docker
○ Integrations with other storage systems
● P2P solutions can work within data centers
● Randomization works
● Get something working first before optimization
○ Hard to predict how P2P works without experimentation
Future Plan
● Performance for massive number of tiny files
● Observability
● Tighter integration with other registry implementations
● Tighter integration with Kubernetes
github.com/uber/kraken

More Related Content

What's hot

Graph databases in computational bioloby: case of neo4j and TitanDB
Graph databases in computational bioloby: case of neo4j and TitanDBGraph databases in computational bioloby: case of neo4j and TitanDB
Graph databases in computational bioloby: case of neo4j and TitanDBAndrei KUCHARAVY
 
M|18 Deep Dive: InnoDB Transactions and Write Paths
M|18 Deep Dive: InnoDB Transactions and Write PathsM|18 Deep Dive: InnoDB Transactions and Write Paths
M|18 Deep Dive: InnoDB Transactions and Write PathsMariaDB plc
 
Logs @ OVHcloud
Logs @ OVHcloudLogs @ OVHcloud
Logs @ OVHcloudOVHcloud
 
MariaDB MaxScale: an Intelligent Database Proxy
MariaDB MaxScale: an Intelligent Database ProxyMariaDB MaxScale: an Intelligent Database Proxy
MariaDB MaxScale: an Intelligent Database ProxyMarkus Mäkelä
 
Basics of Node.js
Basics of Node.jsBasics of Node.js
Basics of Node.jsAlper Unal
 
HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009jarfield
 
Application Caching: The Hidden Microservice (SAConf)
Application Caching: The Hidden Microservice (SAConf)Application Caching: The Hidden Microservice (SAConf)
Application Caching: The Hidden Microservice (SAConf)Scott Mansfield
 
Clusternaut: Orchestrating  Percona XtraDB Cluster with Kubernetes
Clusternaut:  Orchestrating  Percona XtraDB Cluster with KubernetesClusternaut:  Orchestrating  Percona XtraDB Cluster with Kubernetes
Clusternaut: Orchestrating  Percona XtraDB Cluster with KubernetesRaghavendra Prabhu
 
Live migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel EmelyanovLive migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel EmelyanovOpenVZ
 
Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes.
Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes.Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes.
Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes.Raghavendra Prabhu
 
Couchbase live 2016
Couchbase live 2016Couchbase live 2016
Couchbase live 2016Pierre Mavro
 
Introducing TokuMX: The Performance Engine for MongoDB (NYC.rb 2013-12-10)
Introducing TokuMX: The Performance Engine for MongoDB (NYC.rb 2013-12-10)Introducing TokuMX: The Performance Engine for MongoDB (NYC.rb 2013-12-10)
Introducing TokuMX: The Performance Engine for MongoDB (NYC.rb 2013-12-10)leifwalsh
 
gRPC Design and Implementation
gRPC Design and ImplementationgRPC Design and Implementation
gRPC Design and ImplementationVarun Talwar
 
PostgreSQL replication from setup to advanced features.
 PostgreSQL replication from setup to advanced features. PostgreSQL replication from setup to advanced features.
PostgreSQL replication from setup to advanced features.Pivorak MeetUp
 
Mp26 : Tachyon, sloppiness is bliss
Mp26 : Tachyon, sloppiness is blissMp26 : Tachyon, sloppiness is bliss
Mp26 : Tachyon, sloppiness is blissMontreal Python
 
Mystery Machine Overview
Mystery Machine OverviewMystery Machine Overview
Mystery Machine OverviewIvan Glushkov
 

What's hot (19)

Graph databases in computational bioloby: case of neo4j and TitanDB
Graph databases in computational bioloby: case of neo4j and TitanDBGraph databases in computational bioloby: case of neo4j and TitanDB
Graph databases in computational bioloby: case of neo4j and TitanDB
 
Containers and Logging
Containers and LoggingContainers and Logging
Containers and Logging
 
Aurora
AuroraAurora
Aurora
 
M|18 Deep Dive: InnoDB Transactions and Write Paths
M|18 Deep Dive: InnoDB Transactions and Write PathsM|18 Deep Dive: InnoDB Transactions and Write Paths
M|18 Deep Dive: InnoDB Transactions and Write Paths
 
Logs @ OVHcloud
Logs @ OVHcloudLogs @ OVHcloud
Logs @ OVHcloud
 
MariaDB MaxScale: an Intelligent Database Proxy
MariaDB MaxScale: an Intelligent Database ProxyMariaDB MaxScale: an Intelligent Database Proxy
MariaDB MaxScale: an Intelligent Database Proxy
 
Basics of Node.js
Basics of Node.jsBasics of Node.js
Basics of Node.js
 
HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009
 
Fluent Bit: Log Forwarding at Scale
Fluent Bit: Log Forwarding at ScaleFluent Bit: Log Forwarding at Scale
Fluent Bit: Log Forwarding at Scale
 
Application Caching: The Hidden Microservice (SAConf)
Application Caching: The Hidden Microservice (SAConf)Application Caching: The Hidden Microservice (SAConf)
Application Caching: The Hidden Microservice (SAConf)
 
Clusternaut: Orchestrating  Percona XtraDB Cluster with Kubernetes
Clusternaut:  Orchestrating  Percona XtraDB Cluster with KubernetesClusternaut:  Orchestrating  Percona XtraDB Cluster with Kubernetes
Clusternaut: Orchestrating  Percona XtraDB Cluster with Kubernetes
 
Live migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel EmelyanovLive migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel Emelyanov
 
Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes.
Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes.Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes.
Clusternaut: Orchestrating Percona XtraDB Cluster with Kubernetes.
 
Couchbase live 2016
Couchbase live 2016Couchbase live 2016
Couchbase live 2016
 
Introducing TokuMX: The Performance Engine for MongoDB (NYC.rb 2013-12-10)
Introducing TokuMX: The Performance Engine for MongoDB (NYC.rb 2013-12-10)Introducing TokuMX: The Performance Engine for MongoDB (NYC.rb 2013-12-10)
Introducing TokuMX: The Performance Engine for MongoDB (NYC.rb 2013-12-10)
 
gRPC Design and Implementation
gRPC Design and ImplementationgRPC Design and Implementation
gRPC Design and Implementation
 
PostgreSQL replication from setup to advanced features.
 PostgreSQL replication from setup to advanced features. PostgreSQL replication from setup to advanced features.
PostgreSQL replication from setup to advanced features.
 
Mp26 : Tachyon, sloppiness is bliss
Mp26 : Tachyon, sloppiness is blissMp26 : Tachyon, sloppiness is bliss
Mp26 : Tachyon, sloppiness is bliss
 
Mystery Machine Overview
Mystery Machine OverviewMystery Machine Overview
Mystery Machine Overview
 

Similar to KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment with Kraken

PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json  postgre-sql vs. mongodbPGConf APAC 2018 - High performance json  postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json postgre-sql vs. mongodbPGConf APAC
 
Mirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in GoMirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in Golinuxlab_conf
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbWei Shan Ang
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2aspyker
 
Initial presentation of swift (for montreal user group)
Initial presentation of swift (for montreal user group)Initial presentation of swift (for montreal user group)
Initial presentation of swift (for montreal user group)Marcos García
 
Network LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikNetwork LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikGLC Networks
 
DockerCon EU 2015: Breaking the RPiDocker Challenge
DockerCon EU 2015: Breaking the RPiDocker Challenge DockerCon EU 2015: Breaking the RPiDocker Challenge
DockerCon EU 2015: Breaking the RPiDocker Challenge Docker, Inc.
 
Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Nicolas De Loof
 
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | EnglishAWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | EnglishOmid Vahdaty
 
Talk on PHP Day Uruguay about Docker
Talk on PHP Day Uruguay about DockerTalk on PHP Day Uruguay about Docker
Talk on PHP Day Uruguay about DockerWellington Silva
 
Automatic Backup via FTP - Part 1
Automatic Backup via FTP - Part 1Automatic Backup via FTP - Part 1
Automatic Backup via FTP - Part 1GLC Networks
 
Spark Meetup at Uber
Spark Meetup at UberSpark Meetup at Uber
Spark Meetup at UberDatabricks
 
Bsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsdBsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsdScott Tsai
 
Migrating to Apache Spark at Netflix
Migrating to Apache Spark at NetflixMigrating to Apache Spark at Netflix
Migrating to Apache Spark at NetflixDatabricks
 
Introduction to containers
Introduction to containersIntroduction to containers
Introduction to containersNitish Jadia
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadKrivoy Rog IT Community
 
Scaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLScaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLOSInet
 

Similar to KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment with Kraken (20)

PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json  postgre-sql vs. mongodbPGConf APAC 2018 - High performance json  postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
 
Mirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in GoMirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in Go
 
Mongodb meetup
Mongodb meetupMongodb meetup
Mongodb meetup
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodb
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2
 
Initial presentation of swift (for montreal user group)
Initial presentation of swift (for montreal user group)Initial presentation of swift (for montreal user group)
Initial presentation of swift (for montreal user group)
 
Network LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikNetwork LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with Mikrotik
 
DockerCon EU 2015: Breaking the RPiDocker Challenge
DockerCon EU 2015: Breaking the RPiDocker Challenge DockerCon EU 2015: Breaking the RPiDocker Challenge
DockerCon EU 2015: Breaking the RPiDocker Challenge
 
Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Breaking the RpiDocker challenge
Breaking the RpiDocker challenge
 
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | EnglishAWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | English
 
Talk on PHP Day Uruguay about Docker
Talk on PHP Day Uruguay about DockerTalk on PHP Day Uruguay about Docker
Talk on PHP Day Uruguay about Docker
 
Automatic Backup via FTP - Part 1
Automatic Backup via FTP - Part 1Automatic Backup via FTP - Part 1
Automatic Backup via FTP - Part 1
 
Janus & docker: friends or foe
Janus & docker: friends or foe Janus & docker: friends or foe
Janus & docker: friends or foe
 
Spark Meetup at Uber
Spark Meetup at UberSpark Meetup at Uber
Spark Meetup at Uber
 
Bsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsdBsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsd
 
Migrating to Apache Spark at Netflix
Migrating to Apache Spark at NetflixMigrating to Apache Spark at Netflix
Migrating to Apache Spark at Netflix
 
Shootout at the PAAS Corral
Shootout at the PAAS CorralShootout at the PAAS Corral
Shootout at the PAAS Corral
 
Introduction to containers
Introduction to containersIntroduction to containers
Introduction to containers
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
 
Scaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLScaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQL
 

Recently uploaded

Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Denver Web Design brochure for public viewing
Denver Web Design brochure for public viewingDenver Web Design brochure for public viewing
Denver Web Design brochure for public viewingbigorange77
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...
Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...
Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...akbard9823
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Lucknow
 
Complet Documnetation for Smart Assistant Application for Disabled Person
Complet Documnetation   for Smart Assistant Application for Disabled PersonComplet Documnetation   for Smart Assistant Application for Disabled Person
Complet Documnetation for Smart Assistant Application for Disabled Personfurqan222004
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 

Recently uploaded (20)

Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Denver Web Design brochure for public viewing
Denver Web Design brochure for public viewingDenver Web Design brochure for public viewing
Denver Web Design brochure for public viewing
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...
Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...
Sushant Golf City / best call girls in Lucknow | Service-oriented sexy call g...
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
Complet Documnetation for Smart Assistant Application for Disabled Person
Complet Documnetation   for Smart Assistant Application for Disabled PersonComplet Documnetation   for Smart Assistant Application for Disabled Person
Complet Documnetation for Smart Assistant Application for Disabled Person
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
 

KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment with Kraken

  • 1. Kraken P2P Docker Image Distribution
  • 3. Agenda ● Docker image and docker registry internals ● Common ways to speed up docker pull ● P2P solutions ● How Uber solves scale problem with Kraken ● Q&A
  • 4. What is a docker image ● Image layers ○ Regular tar.gz files ○ Each layer = one line in Dockerfile ○ One special layer - image config ■ Defines ENV, USER, etc. ● Image manifest ○ Regular json file ○ Contains SHA256 digests of layers ● Image tag ○ Key-value pair, human-readable name to manifest SHA ● You can easily construct a docker image by hand!
  • 5. What is a docker registry ● A simple web server to store and distribute docker images ● Straightforward REST APIs: GET /v2/ GET /v2/<name>/tags/list GET, PUT, DELETE /v2/<name>/manifests/<reference> GET /v2/<name>/blobs/<digest> POST /v2/<name>/blobs/uploads GET, PUT, PATCH, DELETE /v2/<name>/blobs/uploads/<uuid>
  • 6. What is docker pull ● Resolve tag to manifest ● Pull manifest, find layers not available locally ● Pull tar.gz files ● Decompress them
  • 7. Speed up docker pull ● Make your docker images homogeneous ○ Use a common base image ○ Dockerfile template, multi-stage build ○ Use a build tool that supports distributed layer cache ■ Makisu from Uber, Kaniko from Google, BuildKit from Docker/Moby
  • 8. Scale Docker Registry ● Profile first ● Start with a layer of Nginx caches ○ Ideal for bursty workloads ○ Works better with connection limits ● Nginx was not enough for Uber
  • 9. Uber’s Workload ● Large images ○ 1G average, 10G is becoming common ● Batch jobs ○ Concurrent docker pull - O(10k) ■ Cannot use HDFS ● Host maintenance ○ Reshuffle large number of unique images - O(1k) ■ Cannot add more Nginx ● Replication across zones - on-prem + cloud zones ○ More expensive and complex as Uber add more zones
  • 10. P2P
  • 11. Design Considerations ● Optimize for data center internal usage ○ We control all peers ● Low maintenance ○ No single point of failure ● Handle bursty load ○ O(10k) of same image ○ O(1k) of unique images ● Care about tail completion time
  • 12. Layered Structure ● Easy to understand ○ Just a tree (or trees) ● Fat trees not optimal for big blobs ○ Speed limited by number of branches ● Hard to maintain topology ● e.g. LAD from Facebook
  • 13. Central Overseer ● Divide blob into small data chunks (4MB) ● One central component makes all decisions ○ Schedules P2P transmission of each data chunk for each node ● Optimal in theory, hard to implement ○ Need to support very high QPS ○ Hard to handle node failure and slowdown ● e.g. Dragonfly from Alibaba
  • 14. Random Graph ● A central component makes connection decisions ● Nodes make transfer decisions ● “Random regular graph” ○ Good connectivity, small diameter ○ Jellyfish, NSDI 2012 ● Performant ○ ≈ 80% of max speed in simulation with only one seeder ● Resilient to failures ● Our pick
  • 16. Glossary ● Torrent ○ File broken into multiple pieces, typically 4MB each ○ Pieces transferred independently ● Peer ○ Participant in torrent network ○ Connected peers transfer pieces between each other ○ Peer with 100% of pieces is a seeder
  • 17. Components ● Agent ○ A peer on every host ○ Implements Docker registry interface ● Origin ○ Dedicated seeders ○ Pluggable storage backend (e.g. S3) ○ Self-healing hash ring ● Tracker ○ Tracks peers and seeders in-memory ○ Self-healing hash ring Kraken Architecture
  • 18. Kraken Architecture Key Features ● Just a caching / distribution layer ○ Should be able to suffer total data loss and recover ○ All blobs have TTL ● Minimal dependency set ○ DNS ● Content-addressable blobs ○ Blob identifier is hash of blob content ○ Immutable ○ Disadvantage: not user friendly
  • 19. Kraken Architecture Peer Discovery ● Tracker returns 50 random peers, sorted by preference ○ Completed agents (highest) ○ Origins ○ In-progress agents (lowest) ● Agent iterates through the 50 until it has 10 connections
  • 20. Blue Origin Grey Agent Yellow Agent (downloading) Green Agent (completed)
  • 21. Build Index ● Mapping of tag to manifest SHA256 digest ● No consistency guarantees ○ Client must use unique tags ● Pluggable storage ● Powers image replication between clusters ○ Simple queue with retry Kraken Architecture
  • 22. Global Replication in a Hybrid Cloud Environment ● Kraken cluster in each zone ● Zones in each region share a storage backend
  • 23. Security ● Mutual TLS for all communications with central components ○ End to end security ● P2P traffic doesn’t go through TLS (yet) ○ No need to worry about data integrity
  • 25. Performance in Test Setup ● 3G image with 2 layers ● 2600 hosts (5200 downloads) ● 0.3GB/s speed limit ● Theoretical max 10s Result ● P50 10s ● P99 18s ● Max 32sec ○ Outlier (bad host?)
  • 26. Performance in Production Blobs distributed per day in busiest zone: ● 1mil 0-100MB blobs ● 600k 100MB-1G blobs ● 100k 1G+ blobs Peak ● 20k 100MB-1G blobs within 30 sec ○ With old setup, this would’ve caused outage
  • 27. Optimizations ● Low connection limit ○ Less overhead ● Aggressively disconnect unneeded connections ○ Rebalance network ● Pipelining ○ Maintain a request queue of size n for each connection ○ Less idle time between peers ● Endgame mode ○ For the last few pieces, request from all connected neighbors
  • 28. Unsuccessful Optimizations ● Prefer peers on the same rack ○ Likely to form a disjoint graph ○ Not needed for over-provisioned network ● Reject incoming connection based on number of mutual connections ○ Haven’t seen issues caused by graph density problems
  • 29. Takeaways ● Solution not specific to Docker ○ Integrations with other storage systems ● P2P solutions can work within data centers ● Randomization works ● Get something working first before optimization ○ Hard to predict how P2P works without experimentation
  • 30. Future Plan ● Performance for massive number of tiny files ● Observability ● Tighter integration with other registry implementations ● Tighter integration with Kubernetes