Many will tell you that we can save the planet by switching from gas-guzzling automobiles to electric cars. But Zack Rosen says there's a better way. He'll tell you the impact would be greater if we just switched from virtual machines to Linux containers.

Virtual machines are those things that let anyone run software on the massive cloud computing services offered up by the likes of Amazon, Google, and Microsoft. Rather than setting up its own computer servers, a startup like Netflix or Pinterest can build almost its entire operation atop virtual servers running in the cloud–pieces of software that work much like a real machine. But Rosen believes we can seriously reduce the world's energy consumption if we swap these virtual machines for containers, a suddenly red-hot cloud computing technology that fits neatly into the open source Linux operating system, the OS of choice on the modern web. Among other things, containers can run large software applications in significantly more efficient ways.

Citing multiple studies on power used by cars and data centers, Rosen estimates that, with so much of our software running on cloud services and other operations that use virtual machines, we have a better chance of saving the planet if we just embrace containers. "They're an order of magnitude more efficient," says Rosen, whose company, Pantheon, has long used containers to run its online service, a kind of website publishing platform. "I think you can say–with an absolute straight face–that the containerization of software applications in the age of the cloud will save more CO2 emissions than electric cars."

>'I think you can say—with an absolute straight face—that the containerization of software applications in the age of the cloud will save more CO2 emissions than electric cars.'

That may seem like an extreme stance. But the heart of his argument is worth listening to. Virtual machines are the standard not only on cloud services but inside the (often terribly inefficient) computing centers operated inside the world's private companies, and others will tell you that containers can streamline such operations in enormous ways.

Much like Pantheon, Google uses containers to run its own online services–from Search and Gmail to Google Maps–and according to the company, this has probably helped save it the cost of building an entire data center. Now, in an effort to bring this technology to others, it has already embraced containers on its cloud services–Google Compute Engine and Google App Engine–though it uses a hybrid model where containers exist alongside virtual machines. "Containers just let you get more out of your infrastructure–whether that infrastructure is a bare metal server or a hypervisor-encapsulated virtual machine," says Craig Mcluckie, a product manager who oversees Google's cloud services. "They let you get more out of your basic resources."

The potential gains aren't hard to see. Rosen and his chief technology officer, David Strauss say that, thanks to containers, Pantheon is able to run its servers at about 90 percent efficiency. And Google, which has used containers to run its own online empire for more than a decade, indicates that it achieves similarly high efficiencies. Meanwhile, according one study, on a cloud service like Amazon EC2, the net's most popular, most companies probably run their virtual machines at about 10 percent efficiency. James Hamilton, who oversees data center design and operation at Amazon, indicates that efficiency is much higher on Amazon's cloud. But one of his counterparts at Google, Eric Brewer, says that, without containers, customer utilization on its virtual-machine-based cloud is "kinda low."

There are still many wrinkles that need ironing out, but containers are very much the future of cloud computing. In recent months, a startup called Docker has made the technology far easier to use, bringing it to the attention of the software builders across Silicon Valley. And with Google now behind it, it's poised to break into the mainstream.

Inside the Container

What is a container? Basically, it's a way of encapsulating software–wrapping it in a neat package so that it's isolated from other software running on a computer operating system. If you use a container format that runs on many operating systems, this means you can easily move software applications from machine to machine–something that's vitally important in the cloud computing world, where software is spread across hundreds and even thousands of servers. This is what Docker is trying to facilitate.

But containers also provide what's called "resource isolation." This means is you can carefully control how much of a machine's processing and memory resources are allocated to a particular container. And if you can do that, you can more efficiently squeeze many applications onto the same machine. "It's kind of like slicing a cake," says Pantheon's David Strauss. "You can give each person a slice of cake. Some people can get a proportionally smaller piece and some people get a proportionally larger piece. But everybody gets cake."

You can do something similar with virtual machines. But that means loading multiple virtual machines on each server, all of them running their own operating systems. With containers, you can do resource isolation with a single OS. That means less overhead. That's why, in using the technology inside its own massive online operation–an operation that spans myriad computing facilities across the globe–Google believes it has saved the cost of building an entire data center.

This isn't a new idea. Containers have long been a part of various computer operating systems. But on the Linux OS, Google pretty much invented this kind of resource isolation, creating a container tool called "cgroups." Now, Docker has shaped these containers so that companies and developers more easily move them from machine to machine, and in turn, Google is offering to run Docker containers on its cloud services, which could significantly expand the use of the technology.

>'You can give each person a slice of cake. Some people can get a proportionally smaller piece and some people get a proportionally larger piece. But everybody gets cake.'

Today, Google's cloud services run Docker containers atop virtual machines. According to Eric Brewer–a kind of uber engineer inside Google–virtual machines are still needed to ensure that these services can run software from many different companies without letting data leak between them. Containers also provide security against data leaks, but for Brewer and others, they don't yet provide the level of security you get with virtual machines, a much more mature and widely used technology.

Alex Polvi, the founder of CoreOS, a startup that offers a new version of the Linux operating system specifically designed to run containers, says this is the reason no major cloud service has abandoned virtual machines in favor of containers. "It's mainly about security," he says.

But Rosen and Strauss argue that the needed security is already there, and they believe that the Googles and the Amazons will eventually offer cloud services that run software entirely with containers–without virtual machines. Google says that even when virtual machines are still in the mix, containers can significantly improve the efficiency of online applications, thanks to the way cgroups work. But if you cut virtual machines out of the equation entirely, you can save even more computing power.

This is the argument you hear from Rosen and Strauss. Although Google agrees–at least in part–we're still a long a way from the completely containerized cloud. But we're certainly moving in that direction. Just last week, Rackspace–another big name in the cloud computing game–introduced a cloud service that does way with virtual machines. The wrinkle is that each machine offered up by the service only runs software from a single customer. That's how Rackspace gets around the security issue. That means it can't achieve the efficiency you would get by carefully packing everyone's software containers into one enormous cloud service. But someday, perhaps it will.

Update 9:15 EST 06/25/14: This story has been updated with additional comment from Amazon's James Hamilton and Google's Eric Brewer.