|
|
Subscribe / Log in / New account

CoreOS looks to move from Btrfs to overlayfs

LWN.net needs you!

Without subscribers, LWN would simply not exist. Please consider signing up for a subscription and helping to keep LWN publishing

By Jake Edge
December 24, 2014

After many years of different union filesystem implementations trying to get into the mainline, the overlay filesystem (also known as overlayfs) was finally merged for 3.18. It didn't take all that long for at least one project to notice and react to that addition. CoreOS, which is a Linux distribution for large server deployments, is now planning to move its root filesystem images from Btrfs to ext4—with overlayfs on top.

Various filesystem features are used by Docker (which is the mechanism used to run applications on CoreOS—at least for now) to put read-write filesystems atop the read-only base that provides the root filesystem. In addition, Docker applications each have their own read-only filesystem layer that is currently typically handled in CoreOS by using Btrfs's copy-on-write and snapshot features. Moving to a union filesystem like overlayfs will provide the same basic functionality, just using different underlying techniques.

Brandon Phillips proposed the switch to the coreos-dev mailing list on December 15 and the reaction has generally been quite positive. Btrfs is, it seems, still a bit immature. As Phillips noted: "CoreOS users have regularly reported bugs against btrfs including: out of disk space errors, metadata rebalancing problems requiring manual intervention and generally slow performance when compared to other filesystems".

That proposal was greeted by responses from several others who had seen the problems that Phillips mentioned. Seán C. McCord pointed out that he is a Btrfs proponent, but would still be happier using ext4 and overlayfs:

The out-of-space / metadata balancing problem has bitten me more times than I care to count. It's essentially a fact of life that I have to blow away /var/lib/docker and all its subvolumes every few weeks on any given machine, to clear an out-of-space problem (though `df` shows a usage of, say, 30%).

But, in the only real opposition seen in the thread, Morgaine Fowle noted his excitement about the features that Btrfs brings to the table and thinks CoreOS should be focusing on those, rather than what he sees as a cobbled-together solution using overlayfs. Furthermore:

I deeply enjoy the file-system taking responsibility for snapshotting. It creates a consistent management interface that's useful for a wide range of tasks. Anything based off overlayfs is going to have to concoct it's own unique management layer which will require it's own domain knowledge to handle, where-as someone proficient with the filesystem's snapshotting tools is going to have a more general, portable knowledge they'll be able to use to make sense of what CoreOS is doing naturally.

But, according to Phillips's proposal, overlayfs will bring some benefits beyond just more stability. He pointed to a Red Hat evaluation of storage options for Docker that showed overlayfs as a faster choice for creating and destroying containers. In addition, it also said that overlayfs uses memory more efficiently since it can keep a single copy of a file's pages in the page cache, which can then be used by multiple containers. Since there tends to be a lot of overlap between containers, this can result in significant performance improvements. There are some downsides to overlayfs, too, of course, including that changes to files in the underlying read-only layer requires a potentially costly copy-up operation.

Btrfs creator Chris Mason also posted to the thread. He noted that a number of the problems ("warts") that CoreOS users were running into are being addressed:

The 3.19 merge window fixes some very hard to find corruption problems that we've been chasing down, and Josef Bacik has developed a slick power-fail testing target that makes it much easier to prevent similar bugs in the future. 3.19 will also fix rare corruptions with block group removal, making both balance and the new auto-blockgroup cleanup feature much more reliable.

Overall, though, Mason was not particularly disappointed or unhappy about the proposal to switch to overlayfs, saying that CoreOS should choose the storage solution that best fits its needs. He was also glad to see projects looking to adopt overlayfs now that it has been added to the kernel. Similarly, Greg Kroah-Hartman congratulated CoreOS for using overlayfs in a post to Google+.

The main change outlined by Phillips would be to move the root filesystem images from Btrfs to ext4. Eventually, the Docker overlayfs graph backend would be made the default, but existing Btrfs-based CoreOS systems would continue to work as they are. Given that there were almost no complaints about the proposal, with multiple posts agreeing (as well as quite a few "+1" posts), it would appear to be the path forward for CoreOS.

It should be noted that overlayfs itself has only been in the kernel for a short time. The patches been around for quite a while now, and have been used by various distributions along the way, but it probably still has a few bugs that will need to be shaken out. It is far less complex than Btrfs, however, which presumably reduces the risks of switching from one immature storage technology to another. At this point, openSUSE is the only major distribution to have adopted Btrfs as its default filesystem, though others have discussed it.

One conclusion seems inevitable, though: even after many years of development, Btrfs has not reached a level of functionality, performance, and stability required by some. Mason's message provides some hope that we are getting there, but that has seemingly been true for a while now. When we actually get "there" is still anyone's guess at this point.


Index entries for this article
KernelBtrfs
KernelFilesystems/Btrfs
KernelFilesystems/Union


(Log in to post comments)

CoreOS looks to move from Btrfs to overlayfs

Posted Dec 25, 2014 16:23 UTC (Thu) by ibukanov (subscriber, #3942) [Link]

btrfs is in development for over 7 years. Compare that with ZFS that started in 2001 and in less then 6 years became a part of Solaris. What is so special about btrfs that makes it hard to reach real production stability? Is it just luck of development resources?

CoreOS looks to move from Btrfs to overlayfs

Posted Dec 26, 2014 20:15 UTC (Fri) by andlarry (guest, #49544) [Link]

They're trying to solve a really hard problem.

My understanding (based on watching Bryan Cantrill and Brendan Gregg presentations) is that special circumstances at Sun during that period lead to senior devs with time but little management oversight, resulting in things like ZFS and dtrace. That combined with the fact that Sun really needed Solaris 10 to succeed means this functionality got lots of love and marketing.

Every couple of years I check in and try btrfs out in a new install, still not-quite-there when I checked two years ago (the metadata daemon was giving my processor fan too much of a workout). Makes sense that CoreOS would move to something trying to solve an easier problem.

BTW, Btrfs-devs, thanks for the all the work, I keep noticing progress when I check-in, you'll get there! Keep cracking.

CoreOS looks to move from Btrfs to overlayfs

Posted Dec 26, 2014 3:49 UTC (Fri) by ncm (guest, #165) [Link]

I didn't get a sense of whether the file-system-full and other problems were acknowledged and the subject of intense scrutiny, or if even-more urgent problems dominate btrfs developers' attention.

But I feel obliged to credit Chris Mason's gracious reaction to the news. The Free-software world would be a better place to live and work if everyone would look to his example.

I wonder if extant sites could just as well put overlayfs on top of their existing btrfs images.

CoreOS looks to move from Btrfs to overlayfs

Posted Dec 26, 2014 14:30 UTC (Fri) by masoncl (subscriber, #47138) [Link]

I'm definitely disappointed that we're not there yet for CoreOS. But, I always want projects to pick the best tools for them, and I don't expect CoreOS (or anyone else) to spend their development hours on filesystem bugs.

This is why I'm so excited about Btrfs deployments here at FB. We can carefully watch just about any workload and fix any problems with short turn arounds. How does Btrfs perf compare after six months of aging? We've got Btrfs and xfs side by side in identical configurations, so we can find out.

I'm want to see CoreOS and every other project using Linux succeed, and just try to spend my time making it easier for them to do so. I've been cheering on Linux adopters for a long time, and I'll keep doing it regardless of which FS they use.

CoreOS looks to move from Btrfs to overlayfs

Posted Dec 27, 2014 0:03 UTC (Sat) by reubenhwk (guest, #75803) [Link]

I'm definitely in the BTRFS-is-awesome camp, but I'm in the BTRFS-not-ready-for-production camp as well. Feature-wise, it's a leap ahead of the rest of the Linux filesystems, but it is a bit lacking in the years of production usage.

I'm looking forward to the day I can make instant, persistent copies with COW in production environments.

Thank you for your efforts.


Copyright © 2014, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds