In the DockerCon closing keynote Dieter Reuter from Hypriot presented a demo running 500 Docker containers on a Raspberry Pi 2 device. Convinced that this number of containers could be at least doubled, Dieter then challenged the Docker community to beat his personal record. As of now, the current record stands at 2334 web servers running in containers on a single Raspberry Pi 2.
You can see the original demo here:
Beat his record and get the highest number of web servers running in containers to run concurrently on a Raspberry Pi 2 and you will be awarded a DockerCon Europe ticket and a speaking/demo slot during the conference.
1) Use a single Raspberry Pi 2 with a HypriotOS release
2) Use Docker Engine to start the containers
3) Use the web server container “hypriot/rpi-busybox-httpd” as a starting point – you can use whatever webserver you like, but you have to serve the static website with the same index.html + .jpg
4) The challenge ends on Monday, October 19th, 2015 at 17:00 PDT – winner will be announced on Tuesday, October 20th
5) We must be able to reproduce your results on our own RPi2, so your container and code must be published publicly
6) Tweet your submission using the the #RPiDocker hashtag
7) Participants must submit any changes made to docker engine with appropriate tests back to the Docker project or must be independently reproducible with the stock Docker engine release. Optimizations must be general optimizations, useful outside of the scope of this specific benchmark.
Insights from the Current Leader
Damien Duportal holds the current record with 2334 containers on a Raspberry Pi device
This challenge forces you to know the limits of your tools, and to use them in the right context. And it does this in one of the smaller environments out there.
How did we achieve this?
First we did the math:
• A RPi 2 has 1Gb of RAM (about 975 Mb available)
• The memory footprint of those single web server outside a container is ~0.3 Mb
• So we theoretically use 700 Mb (2334 instances) for “real” processes footprint, which leaves us 300 Mb for the system and the Docker engine
• We reached a physical limit due to the Docker engine overhead: the challenge is here by tracking what can be done to improve that and make Docker better and better
Specs for our set-up
• Raspberry Pi 2 (4x core, 1 GByte memory)
• Docker 1.8.1 (stock version, w/o any optimisations)
• Linux: Debian Wheezy (HypriotOS from 4/16/2015) with Kernel 3.18.11 – same as used for DockerCon demo
• Web server: Docker Image “hypriot/rpi-nano-httpd:minimal” (available on Docker Hub)
We didn’t change the Docker source code at all! This was already possible with the stock version and only tweaking the Linux system and the container. The Docker team has done an incredible job, but there’s always room for further improvements – until now, we just scratched the surface. So join the challenge and go put MOAAAR whales inside your Raspberry!
Tips to get started:
• Find an image with the lowest footprint as possible. We think that the “hypriot/rpi-nano-httpd” image from Hypriot is quite impressive at < 99 Kb.
• Master Docker settings by closely reading the Docker Engine documentation. Pay particular attention to network configuration.
• Raspberry Pi tuning, in other words “How to gain some precious” Mb: Fine-tune video memory, disable unused services, and more. Try:
• Reduce the stack size used for starting Docker subprocesses (see /etc/init.d/docker)
• Optimize the httpd container in order to use less memory
• Make modifications to the docker container itself, and document what you did. And contribute back to Docker.
• Fine tune Linux: same as Docker, but requires much more research. Kernel hacking is not a free lunch, but totally worth it for what you learn.
We’re really excited to see what you come up with too!
For more information, check out this short list of resources to get you started with Docker and Hypriot on Raspberry Pi:
Happy hacking and hope to see you at DockerCon Europe 2015!
— Damien Duportal (@DamienDuportal) August 26, 2015
Learn More about Docker
- New to Docker? Try our 10 min online tutorial
- Share images, automate builds, and more with a free Docker Hub account
- Read the Docker 1.8 Release Notes
- Subscribe to Docker Weekly
- Register for upcoming Docker Online Meetups
- Attend upcoming Docker Meetups
- Register for DockerCon Europe 2015
- Start contributing to Docker