Skip to main content

Your submission was sent successfully! Close

Thank you for signing up for our newsletter!
In these regular emails you will find the latest updates from Canonical and upcoming events where you can meet our team.Close

Thank you for contacting us. A member of our team will be in touch shortly. Close

  1. Blog
  2. Article

Dustin Kirkland
on 11 June 2015



652 Linux containers running on a Laptop?  Are you kidding me???

A couple of weeks ago, at the OpenStack Summit in Vancouver, Canonical released the results of some scalability testing of Linux containers (LXC) managed by LXD.

Ryan Harper and James Page presented their results — some 536 Linux containers on a very modest little Intel server (16GB of RAM), versus 37 KVM virtual machines.

Ryan has published the code he used for the benchmarking, and I’ve used to to reproduce the test on my dev laptop (Thinkpad x230, 16GB of RAM, Intel i7-3520M).

I managed to pack a whopping 652 Ubuntu 14.04 LTS (Trusty) containers on my Ubuntu 15.04 (Vivid) laptop!

The system load peaked at 1056 (!!!), but I was using merely 56% of 15.4GB of system memory.  Amazingly, my Unity desktop and Byobu command line were still perfectly responsive, as were the containers that I ssh’d into.  (Aside: makes me wonder if the Linux system load average is accounting for container process correctly…)

Check out the process tree for a few hundred system containers here!

As for KVM, I managed to launch 31 virtual machines without KSM enabled, and 65 virtual machines with KSM enabled and working hard.  So that puts somewhere between 10x – 21x as many containers as virtual machines on the same laptop.

You can now repeat these tests, if you like.  Please share your results with #LXD on Google+ or Twitter!

I’d love to see someone try this in AWS, anywhere from an m3.small to an r3.8xlarge, and share your results.

Density test instructions

## Install lxd
$ sudo add-apt-repository ppa:ubuntu-lxc/lxd-git-master
$ sudo apt-get update
$ sudo apt-get install -y lxd bzr
$ cd /tmp
## Grab the tests, disable the tools download
$ bzr branch lp:~raharper/+junk/density-check
$ cd density-check
$ mkdir lxd_tools
## Periodically squeeze your cache
$ sudo bash -x -c 'while true; do sleep 30;
echo 3 | sudo tee /proc/sys/vm/drop_caches;
free; done' &
## Run the LXD test
$ ./density-check-lxd --limit=mem:512m --load=idle release=trusty arch=amd64
## Run the KVM test
$ ./density-check-kvm --limit=mem:512m --load=idle release=trusty arch=amd64

As for the speed-of-launch test, I’ll cover that in a follow-up post!

Related posts


Canonical
28 March 2025

KubeCon Europe 2025: Containers & Connections with Ubuntu

container Article

It’s hard to believe that the first KubeCon took place nearly 10 years ago. Back then, Kubernetes was still in its early days, and the world was only just beginning to understand the power of container orchestration. Fast-forward to today, and Kubernetes is a fundamental part of cloud-native development, taught in universities as a key ...


Canonical
25 March 2025

Rivos and Canonical partner to deliver scalable RISC-V solutions in Data Centers and enable an enterprise-grade Ubuntu experience across Rivos platforms 

Canonical announcements Article

Rivos Inc. brings scalable, high-performance AI accelerating solutions to the Data Center, helping to turn the benefits of both AI and Data Analytics into a reality. Rivos is  working with Canonical to deliver the widely utilized Ubuntu OS on top of the Data Center-class integrated RISC-V CPU and innovative GPGPU solution from Rivos.  Thi ...


Canonical
18 March 2025

Ubuntu now officially supports NVIDIA Jetson: powering the future of AI at the edge

AI Article

Canonical announces the General Availability of Ubuntu for the NVIDIA® Jetson Orin™ for edge AI and robotics, bringing optimized performance, out-of-the-box compatibility, and an easy pathway to high-performance AI solutions for AI developers everywhere. Canonical, the publisher of Ubuntu, announced official support for the NVIDIA Jetson ...