Why Containers?

A whole new world, magic carpet sold separately.

If you’ve been paying attention to internet infrastructure and DevOps news, you’ve probably heard a lot about Linux containers—perhaps from the surging popularity of Docker, a tool-suite for container development. What are these things, and why have they got everyone so excited?

What’s a Container?

Containers are made possible by a set of facilities in the Linux Kernel that allow lightweight partitioning of a host operating system into isolated spaces—containers—where applications can safely run. Frequently, a container solution also includes a standard spec for defining the contents and dependencies of its applications.

Containers came to Linux starting in the mid-aughts, when Google engineers got the foundational pieces accepted as patches to the Kernel. Since then, development on the concept has steadily progressed. Containers hit a tipping point in 2014.

[Related] Why We Built Pantheon with Containers, Not Virtual Machines

What Are the Benefits?

People are excited because containers represent the next step forward in how applications are defined—from when engineers set them up to when they’re deployed and run at scale.

The primary benefits of containers are efficiency and agility. Containers are orders of magnitude faster to provision, and much lighter-weight to build and define versus methods like omnibus software builds and full Virtual Machine images. Containers in a single OS are also more efficient at resource utilization than running a Hypervisor and guest OSs.

Containers aren’t only faster and easier to use than VMs; they also make far more efficient use of computing hardware.

Efficiency and agility are good for everyone, but they become game-changers at scale. Companies like Google, Facebook, and Salesforce leverage containers to make large engineering teams more productive and to improve utilization of compute resources. In fact, Google credited containers for eliminating the need for an entire data center.

Why Pantheon Chose Containers Instead of VMs

Pantheon’s platform has been container-based ever since it became Generally Available. We have over one million containers under management. We literally could not exist if we had to manage an EC2 instance for every one of those environments. It would be financial and operational madness. Virtual Machines are too slow, too error-prone, and too inefficient to power a top-flight website management platform.

The benefits we enjoy include:

  1. Very fast provisioning: Containers are provisioned via software into already-operating infrastructure. We can add, remove, and redistribute containers in seconds. In fact, when development sites are idle we spin them down and resurrect their containers in real time as the first page requests come in.

  2. Simple, high availability: We run the containers on different underlying hardware. If one host goes down, we can route traffic from the Edge to live application containers running elsewhere.

  3. Smooth scaling: Containers let us take sites from hundreds of pageviews to hundreds of millions of pageviews without any downtime or architectural changes. This is hard when you have a VM-centric hosting architecture. Vertical scale requires reboots to resize, and horizontal scale introduces painful architectural gaps.

  4. Machine-precision consistency: Every app container running on a site on Pantheon is exactly the same. The platform is a giant, robotic, share-nothing matrix. Containers are provisioned automatically on identical infrastructure, and can only be managed via Pantheon's automated tools. There are no gotchas when servers get out of sync.

  5. Better performance: Containers make scaling up much more affordable and granular. Since the resource cost of a small set of processes is so much less than even the tiniest cloud instances capable of running a Drupal installation, you can spread out across many machines without breaking the bank.

You can read a more in-depth blog post on why Pantheon built with Containers instead of Virtual Machines here.

The Future of Containers

Big internet companies like Google and Salesforce have been utilizing containers for nearly a decade. And we’ve been building with containers for over four years. But it’s still early days for containers.

A number of exciting open source initiatives are helping to popularize and refine best practices in containers, from Docker to CoreOS to RedHat’s OpenShift. We expect to see more SaaS services adopt containers as their primary architecture, as well as seeing new offerings from PaaS and IaaS providers to help systems engineers get containerized apps online faster.

At Pantheon, we view our role as helping to drive mass adoption of open source website technologies by bringing radical gains in efficiency, agility, and performance to customers who have historically been stuck on legacy proprietary systems, self-hosting (via internal IT or EC2), and traditional managed hosting.