SlideShare a Scribd company logo
Breaking the RPiDocker Challenge
Nicolas De Loof
Yoann Dubreuil
Damien Duportal
RPiDocker
Challenge
3
—Author Name
“Let’s break the challenge.”
4
Methodology
“Measure and automate all
the things.”
Damien Duportal
@DamienDuportal
1 - Measure and automate all the things
Measures :
● sysstat for post mortem
● node-collector from Prometheus.io for “real time”
Provisionning :
● Basic shell script published on Damien’s Github
Yoann Dubreuil
@YoannDubreuil
“Brainstorm for ideas,
then test everything
in arbitrary order”
Nicolas De loof
@ndeloof
“... and have some beer”
Nicolas & Yoann : Where to start ?
● first naïve try
○ only 38 containers :-
○ but 70 on a RPi1 #WTF?
● figure out RPi2 limits without Docker
○ web server footprint
○ network namespace footprint
● get some help !
○ let’s collaborate with @DamienDuportal (aka “French mafia”)
2 - Systemd tuning
Docker daemon run as root
… but still has some limits set by systemd (so the 38 containers...)
LimitSIGPENDING=infinity
LimitNOFILE=infinity
LimitAS=infinity
LimitNPROC=infinity
LimitSTACK=?
● Default stack size is 8Mb
○ a stack consume 8Mb of process VM space (8 * 4 * 38 = 1,2 Gb)
=> tweak LIMITSTACK for ~ 1800 / 2000 containers
3 - Lower the container footprint
● Tried with custom compiled nginx for ARM with few extensions
~ 80 containers
● Footprint is too big per container. Reading carefully Hypriot Blog : "rpi-
nano-httpd" : written in ARM assembly code, already highly optimized
➢ 1 page for code
➢ 1 page for data
➢ 1 page for stack
➢ 1 page for vsdo
=> 16kb memory footprint per process !
~150 containers
● launched 27.000 on a RPi2
network namespace RPi2 limit
● launched web server in a dedicated network namespace
ip netns exec <NS_NUMBER> httpd
● RPi2 limit is ~ 1.100 network namespace
=> To break the challenge, we needed to run without network isolation
--net=host
Reached ~ 1000 containers
4 - Speed up testing !
launching thousands of containers on a RPi2 takes
hours if not days!
● everything in memory with zram devices
○ swap (ratio 5:1)
○ /var/lib/docker on ext4 FS (ratio 10:1)
● swap as early as possible to keep free memory (vm.swappiness = 100)
● more CPU for GO with GOMAXPROCS=4
● reduce kernel perf event slowdown
○ kernel.perf_cpu_time_max_percent = 1
● USB external disk vs low perf, I/O limited SD card
5 - Docker tuning
● Disable proxy process : no use here
● No logging : --log-driver=none
● Disable network / port forwarding
--bridge=none --iptables=false --ipv6=false --ip-
forward=false --ip-masq=false
--userland-proxy=false -sig-proxy=false
● reduce Golang memory consumption
○ launched docker with GODEBUG=gctrace=1 GOGC=1
6 - System tuning
● limit memory consumption
○ reduce GPU memory to 16Mb (can’t do less)
○ blacklisted non required Linux modules
● remove some Linux limits
○ vm.overcommit = 1
○ kernel.pid_max = 32768
○ kernel.threads-max = 14812
● reduce thread stack size
○ smallest working thread stack size: 24kb
●
Did not work
● Btrfs
○ not working properly : strange web server 404 failures after ~20
successful launchs
○ stick with overlayfs
● LXC driver
○ way sloooooooower
○ 4 threads per container anyway
● Go 1.5
○ compiled Docker with Go 1.5 for “better GC”, had no significant impact
Challenge
Completed
● We started 2499containers !
● RAM on RPi2 was not exhausted but Docker daemon crashed
docker[307]: runtime: program exceeds 10000-thread limit
Why is there a limit ?
4 threads per container
● 10.000 threads for a Go application => 2500 containers max
Need to understand why Docker do need 4 threads per container
(hey, lot’s of Docker core contributors here, time to ask !)
Worked around this with runtime.debug.SetMaxThread(12000)
● hack not eligible for RpiDocker challenge, was just to confirm
● can run ~2740webserver containers, before actual OOM
“Collaboration (and beer)
were the keys to break this
challenge !.”
Thank you!
@ndeloof @YoannDubreuil @DamienDuportal

More Related Content

PDF
Docker 1.11 @ Docker SF Meetup
PDF
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
PPTX
DCUS17 : Docker networking deep dive
PDF
Container Performance Analysis
ODP
Why Docker? Dayton PHP, April 2017
PDF
runC: The little engine that could (run Docker containers) by Docker Captain ...
PDF
Introduction to Docker & CoreOS - Symfony User Group Cologne
 
PDF
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
Docker 1.11 @ Docker SF Meetup
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
DCUS17 : Docker networking deep dive
Container Performance Analysis
Why Docker? Dayton PHP, April 2017
runC: The little engine that could (run Docker containers) by Docker Captain ...
Introduction to Docker & CoreOS - Symfony User Group Cologne
 
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi

What's hot (20)

PDF
Troubleshooting Tips from a Docker Support Engineer
PDF
Container Orchestration from Theory to Practice
PDF
Leveraging the Power of containerd Events - Evan Hazlett
PDF
[DockerCon 2019] Hardening Docker daemon with Rootless mode
PDF
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
PPT
Docker Multi Host Networking, Rachit Arora, IBM
PDF
Containerd: Building a Container Supervisor by Michael Crosby
PDF
Container-relevant Upstream Kernel Developments
PDF
Project Atomic-Nulecule
PDF
Docker 原理與實作
PDF
Fluentd and docker monitoring
PPTX
Docker Networking in OpenStack: What you need to know now
PDF
Kernel load-balancing for Docker containers using IPVS
PDF
What's New in Docker 1.12?
PDF
Introduction to docker
PDF
Wso2 con 2014-us-tutorial-apache stratos-wso2 private paas with docker integr...
PPTX
QNAP COSCUP Container Station
PDF
Endocode Kubernetes Meetup: Architecture Patterns for Microservices in Kubern...
PPTX
Introction to docker swarm
PDF
Docker Networking – Running multi-host applications
Troubleshooting Tips from a Docker Support Engineer
Container Orchestration from Theory to Practice
Leveraging the Power of containerd Events - Evan Hazlett
[DockerCon 2019] Hardening Docker daemon with Rootless mode
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
Docker Multi Host Networking, Rachit Arora, IBM
Containerd: Building a Container Supervisor by Michael Crosby
Container-relevant Upstream Kernel Developments
Project Atomic-Nulecule
Docker 原理與實作
Fluentd and docker monitoring
Docker Networking in OpenStack: What you need to know now
Kernel load-balancing for Docker containers using IPVS
What's New in Docker 1.12?
Introduction to docker
Wso2 con 2014-us-tutorial-apache stratos-wso2 private paas with docker integr...
QNAP COSCUP Container Station
Endocode Kubernetes Meetup: Architecture Patterns for Microservices in Kubern...
Introction to docker swarm
Docker Networking – Running multi-host applications
Ad

Viewers also liked (20)

PPTX
Container Migration Tool
PPTX
DockerCon EU 2015: Using Docker and SDN for telco-grade applications
PDF
DockerCon EU 2015: Production Ready Containers from IBM and Docker
PPTX
The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...
PDF
What's hot docker con eu 2015 &amp; what's new on docker 1.9
PPTX
DockerCon14 Automated Chef Cookbook Testing
PDF
DockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaS
PPTX
DockerCon SF 2015: How to talk to humans
PPTX
Dockerizing Stashboard
PDF
Mobycraft:Docker in 8-bit (Meetup at Docker HQ 4/7)
PPTX
DockerCon 16 - Moby's Cool Hack Session
PDF
Why should I care about stateful containers?
PDF
Distributed, Real-time Web Apps
PDF
How to Successfully Build a Local Docker Community by Mathias Renner
PPT
Developer Week
PDF
Building Images from dockerfiles
PPTX
DockerCon EU 2015: It's in the game: the path to micro-services at Electronic...
PPTX
DockerCon EU 2015: From Local Development to Production Deployments using Ama...
PPTX
DockerCon14 Keynote
PDF
DockerCon SF 2015: From Months to Minutes
Container Migration Tool
DockerCon EU 2015: Using Docker and SDN for telco-grade applications
DockerCon EU 2015: Production Ready Containers from IBM and Docker
The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...
What's hot docker con eu 2015 &amp; what's new on docker 1.9
DockerCon14 Automated Chef Cookbook Testing
DockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaS
DockerCon SF 2015: How to talk to humans
Dockerizing Stashboard
Mobycraft:Docker in 8-bit (Meetup at Docker HQ 4/7)
DockerCon 16 - Moby's Cool Hack Session
Why should I care about stateful containers?
Distributed, Real-time Web Apps
How to Successfully Build a Local Docker Community by Mathias Renner
Developer Week
Building Images from dockerfiles
DockerCon EU 2015: It's in the game: the path to micro-services at Electronic...
DockerCon EU 2015: From Local Development to Production Deployments using Ama...
DockerCon14 Keynote
DockerCon SF 2015: From Months to Minutes
Ad

Similar to DockerCon EU 2015: Breaking the RPiDocker Challenge (20)

PPTX
Docker Online Meetup #27: Raspberry Pi DockerCon Challenge
PDF
Scaleable PHP Applications in Kubernetes
PDF
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
PDF
Docker and friends at Linux Days 2014 in Prague
PDF
Marriage with docker
PDF
Docker 0.11 at MaxCDN meetup in Los Angeles
PDF
Docker Introduction + what is new in 0.9
PDF
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
PDF
Deliver Python Apps with Docker
PPTX
Dockerizing Aurea - Docker Con EU 2017
PDF
Containers, Docker, and Microservices: the Terrific Trio
PDF
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
PPTX
Tribal Nova Docker feedback
PDF
Dockerize your Symfony application - Symfony Live NYC 2014
PDF
Docker Up and Running Introduction
PPTX
runC – Open Container Initiative
PDF
Dockerizing IoT Services
PPTX
Effective images remix
PDF
Shipping python project by docker
PPTX
Dockerize the World
Docker Online Meetup #27: Raspberry Pi DockerCon Challenge
Scaleable PHP Applications in Kubernetes
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Docker and friends at Linux Days 2014 in Prague
Marriage with docker
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker Introduction + what is new in 0.9
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
Deliver Python Apps with Docker
Dockerizing Aurea - Docker Con EU 2017
Containers, Docker, and Microservices: the Terrific Trio
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Tribal Nova Docker feedback
Dockerize your Symfony application - Symfony Live NYC 2014
Docker Up and Running Introduction
runC – Open Container Initiative
Dockerizing IoT Services
Effective images remix
Shipping python project by docker
Dockerize the World

More from Docker, Inc. (20)

PDF
Containerize Your Game Server for the Best Multiplayer Experience
PDF
How to Improve Your Image Builds Using Advance Docker Build
PDF
Build & Deploy Multi-Container Applications to AWS
PDF
Securing Your Containerized Applications with NGINX
PDF
How To Build and Run Node Apps with Docker and Compose
PDF
Hands-on Helm
PDF
Distributed Deep Learning with Docker at Salesforce
PDF
The First 10M Pulls: Building The Official Curl Image for Docker Hub
PDF
Monitoring in a Microservices World
PDF
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
PDF
Predicting Space Weather with Docker
PDF
Become a Docker Power User With Microsoft Visual Studio Code
PDF
How to Use Mirroring and Caching to Optimize your Container Registry
PDF
Monolithic to Microservices + Docker = SDLC on Steroids!
PDF
Kubernetes at Datadog Scale
PDF
Labels, Labels, Labels
PDF
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
PDF
Build & Deploy Multi-Container Applications to AWS
PDF
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
PDF
Developing with Docker for the Arm Architecture
Containerize Your Game Server for the Best Multiplayer Experience
How to Improve Your Image Builds Using Advance Docker Build
Build & Deploy Multi-Container Applications to AWS
Securing Your Containerized Applications with NGINX
How To Build and Run Node Apps with Docker and Compose
Hands-on Helm
Distributed Deep Learning with Docker at Salesforce
The First 10M Pulls: Building The Official Curl Image for Docker Hub
Monitoring in a Microservices World
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
Predicting Space Weather with Docker
Become a Docker Power User With Microsoft Visual Studio Code
How to Use Mirroring and Caching to Optimize your Container Registry
Monolithic to Microservices + Docker = SDLC on Steroids!
Kubernetes at Datadog Scale
Labels, Labels, Labels
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Build & Deploy Multi-Container Applications to AWS
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
Developing with Docker for the Arm Architecture

Recently uploaded (20)

PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Cloud computing and distributed systems.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPT
Teaching material agriculture food technology
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
KodekX | Application Modernization Development
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Approach and Philosophy of On baking technology
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
The AUB Centre for AI in Media Proposal.docx
Cloud computing and distributed systems.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
“AI and Expert System Decision Support & Business Intelligence Systems”
Understanding_Digital_Forensics_Presentation.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
cuic standard and advanced reporting.pdf
NewMind AI Monthly Chronicles - July 2025
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Teaching material agriculture food technology
Spectral efficient network and resource selection model in 5G networks
MYSQL Presentation for SQL database connectivity
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
KodekX | Application Modernization Development
Network Security Unit 5.pdf for BCA BBA.
Advanced methodologies resolving dimensionality complications for autism neur...
Approach and Philosophy of On baking technology

DockerCon EU 2015: Breaking the RPiDocker Challenge

  • 1. Breaking the RPiDocker Challenge Nicolas De Loof Yoann Dubreuil Damien Duportal
  • 3. 3
  • 4. —Author Name “Let’s break the challenge.” 4
  • 6. “Measure and automate all the things.” Damien Duportal @DamienDuportal
  • 7. 1 - Measure and automate all the things Measures : ● sysstat for post mortem ● node-collector from Prometheus.io for “real time” Provisionning : ● Basic shell script published on Damien’s Github
  • 8. Yoann Dubreuil @YoannDubreuil “Brainstorm for ideas, then test everything in arbitrary order”
  • 9. Nicolas De loof @ndeloof “... and have some beer”
  • 10. Nicolas & Yoann : Where to start ? ● first naïve try ○ only 38 containers :- ○ but 70 on a RPi1 #WTF? ● figure out RPi2 limits without Docker ○ web server footprint ○ network namespace footprint ● get some help ! ○ let’s collaborate with @DamienDuportal (aka “French mafia”)
  • 11. 2 - Systemd tuning Docker daemon run as root … but still has some limits set by systemd (so the 38 containers...) LimitSIGPENDING=infinity LimitNOFILE=infinity LimitAS=infinity LimitNPROC=infinity LimitSTACK=? ● Default stack size is 8Mb ○ a stack consume 8Mb of process VM space (8 * 4 * 38 = 1,2 Gb) => tweak LIMITSTACK for ~ 1800 / 2000 containers
  • 12. 3 - Lower the container footprint ● Tried with custom compiled nginx for ARM with few extensions ~ 80 containers ● Footprint is too big per container. Reading carefully Hypriot Blog : "rpi- nano-httpd" : written in ARM assembly code, already highly optimized ➢ 1 page for code ➢ 1 page for data ➢ 1 page for stack ➢ 1 page for vsdo => 16kb memory footprint per process ! ~150 containers ● launched 27.000 on a RPi2
  • 13. network namespace RPi2 limit ● launched web server in a dedicated network namespace ip netns exec <NS_NUMBER> httpd ● RPi2 limit is ~ 1.100 network namespace => To break the challenge, we needed to run without network isolation --net=host Reached ~ 1000 containers
  • 14. 4 - Speed up testing ! launching thousands of containers on a RPi2 takes hours if not days! ● everything in memory with zram devices ○ swap (ratio 5:1) ○ /var/lib/docker on ext4 FS (ratio 10:1) ● swap as early as possible to keep free memory (vm.swappiness = 100) ● more CPU for GO with GOMAXPROCS=4 ● reduce kernel perf event slowdown ○ kernel.perf_cpu_time_max_percent = 1 ● USB external disk vs low perf, I/O limited SD card
  • 15. 5 - Docker tuning ● Disable proxy process : no use here ● No logging : --log-driver=none ● Disable network / port forwarding --bridge=none --iptables=false --ipv6=false --ip- forward=false --ip-masq=false --userland-proxy=false -sig-proxy=false ● reduce Golang memory consumption ○ launched docker with GODEBUG=gctrace=1 GOGC=1
  • 16. 6 - System tuning ● limit memory consumption ○ reduce GPU memory to 16Mb (can’t do less) ○ blacklisted non required Linux modules ● remove some Linux limits ○ vm.overcommit = 1 ○ kernel.pid_max = 32768 ○ kernel.threads-max = 14812 ● reduce thread stack size ○ smallest working thread stack size: 24kb ●
  • 17. Did not work ● Btrfs ○ not working properly : strange web server 404 failures after ~20 successful launchs ○ stick with overlayfs ● LXC driver ○ way sloooooooower ○ 4 threads per container anyway ● Go 1.5 ○ compiled Docker with Go 1.5 for “better GC”, had no significant impact
  • 18. Challenge Completed ● We started 2499containers ! ● RAM on RPi2 was not exhausted but Docker daemon crashed docker[307]: runtime: program exceeds 10000-thread limit
  • 19. Why is there a limit ? 4 threads per container ● 10.000 threads for a Go application => 2500 containers max Need to understand why Docker do need 4 threads per container (hey, lot’s of Docker core contributors here, time to ask !) Worked around this with runtime.debug.SetMaxThread(12000) ● hack not eligible for RpiDocker challenge, was just to confirm ● can run ~2740webserver containers, before actual OOM
  • 20. “Collaboration (and beer) were the keys to break this challenge !.”