Contact
Contact

BlogData center

Ceph vs ZFS: Which One Fits Your Storage, and When to Use Both

6 min read

Ceph and ZFS solve different problems, so a feature-by-feature comparison misses the point. ZFS is a file system and volume manager that lives inside one server and protects the data on its disks extremely well.

Ceph vs ZFS: Which One Fits Your Storage, and When to Use Both

Ceph spreads data across several servers so that losing a whole machine doesn’t lose anything. What decides between them is whether your storage has to survive the death of a server without losing a single write, and the answer usually depends on how many servers you have and what network joins them.

Proxmox VE offers both from the installer and the web interface, so the examples below use it, although the same applies to any Linux deployment.

What ZFS does

ZFS combines RAID, volume management and the file system in one layer. Every block is checksummed, so it detects silent corruption and repairs it from the redundant copy; snapshots and clones are instant because nothing is overwritten in place; and LZ4 compression costs so little CPU that it is usually left on. It wants direct access to the disks, without a hardware RAID controller in between, and it uses RAM as a read cache (the ARC). Proxmox caps that cache by default at 10% of the host’s memory, up to 16 GiB.

Its limit is the server itself. A ZFS pool belongs to one machine, and if that machine’s motherboard dies, the data is safe on the disks but nobody can reach it until the server is repaired or the disks are moved to another one.

What Ceph does

Ceph turns the disks of several servers into one pool. Each disk is run by an OSD daemon, and by default every piece of data is written to three different servers before the write is confirmed, with I/O continuing as long as two copies are reachable (size 3, min_size 2). If a server dies and high availability is enabled, the virtual machines that were running on it restart on another node with all their data, because the other two copies were already up to date. The same cluster can serve virtual machine disks (RBD), a shared file system (CephFS) and S3 object storage (RGW).

That comes at a price in hardware. Proxmox requires at least three servers, preferably identical, and recommends at least 10 Gbps dedicated to Ceph traffic and SSDs with power-loss protection, and each OSD takes 4 GiB of RAM by default. A three-node cluster on a shared 1 Gbps network will work in a lab and disappoint in production.

What happens when a server dies

With ZFS on several Proxmox nodes, you can use storage replication: every so often, every 15 minutes by default, the node sends the changes of each virtual machine to another node. If the first node fails, the high availability manager starts the VM on the second one, but with the data from the last replication, so anything written in those minutes is lost. For a web server or a domain controller that is often acceptable. For a database or an ERP, it usually isn’t.

With Ceph, every write already exists on three servers by the time the application sees it confirmed. The VM restarts elsewhere with the data as it was at the moment of the failure, and the cluster rebuilds the missing copy in the background.

Performance

On a single server with NVMe drives, ZFS will give one virtual machine lower latency than Ceph, because each Ceph write goes over the network to the disk that owns it, which copies it to two more servers before confirming. Ceph makes up for it in aggregate: many virtual machines across many nodes read and write in parallel against all the disks of the cluster, and adding servers adds performance as well as capacity. In practice, the network sets Ceph’s ceiling, and consumer SSDs without power-loss protection are what make both of them slow under synchronous writes.

Growing the storage

ZFS grows inside one box. You can add another group of disks to the pool, and since OpenZFS 2.3 a RAID-Z group can also be widened one disk at a time, but you are limited by the bays and the controllers of that server. Ceph grows by adding disks or whole servers anywhere in the cluster, and it rebalances the data on its own. In exchange, three full copies use more raw capacity than a ZFS RAID-Z2 pool. Ceph can use erasure coding instead, but it needs at least as many servers as data and parity chunks combined, so on a three- or four-node cluster it is rarely an option for virtual machine disks.

Ceph vs ZFS at a glance

ZFSCeph
ScopeOne serverCluster of three or more servers
Losing a serverData safe on disk but unreachable; with Proxmox replication, failover loses the writes since the last syncVMs restart elsewhere with no data loss
NetworkNothing special; replication uses the cluster network10 Gbps or more, dedicated (recommended)
Latency for one VMLowerHigher, every write crosses the network
GrowthWithin the server’s baysAdd disks or servers anywhere
Raw capacity usedRAID-Z2: two disks of parity per groupThree copies by default
Fits bestOne or two nodes, local data, backup targetsThree or more nodes with VMs that must not lose data

Which one to choose

With one or two servers, ZFS, with storage replication between them if there are two, and a QDevice to give the cluster its third vote. With three or more servers, a fast dedicated network and virtual machines that can’t afford to lose recent writes, Ceph. And in many clusters, both: ZFS for the boot disks and for local data that doesn’t need to move, Ceph for the virtual machines. If you are coming from VMware and vSAN, Ceph is the closest equivalent, and we cover the rest of that move in our guide to migrating from VMware to Proxmox.

Frequently asked questions

Is Ceph slower than ZFS?

For a single virtual machine, usually yes, because every Ceph write goes over the network and is stored on three servers before it is confirmed. Ceph wins on aggregate throughput and on surviving the loss of a server.

How many nodes do I need for Ceph?

At least three, preferably identical. With fewer, ZFS with storage replication fits better.

Does ZFS replication in Proxmox give me high availability?

It gives you failover, but the VM comes back with the data from its last replication, every 15 minutes by default.

Can I use ZFS and Ceph in the same cluster?

Yes. A common layout is ZFS for boot and local data and Ceph for virtual machines, with Ceph’s OSDs on their own raw disks.

Keep reading

If you need a hand choosing

We design and support storage under Proxmox, OpenStack and Kubernetes, and we use both: ZFS where one server is enough and Ceph where the data has to outlive any single machine. If you are sizing a new cluster, wondering whether your network is ready for Ceph, or running a Ceph cluster that is slower than it should be, our Ceph consulting and support page explains how we work. Before upgrading the nodes themselves, our Proxmox 8 to 9 upgrade guide covers the Ceph steps too, and if your team will run the cluster, start with how to learn Ceph.

Contact us