The filesystem is the foundation of your hosting infrastructure. Every I/O operation โ whether it's serving a WordPress page, streaming a database query, or writing VM disk images โ passes through the filesystem layer. Choosing the right one has a direct impact on performance, data integrity, and operational complexity.
At Hostingowy, we run both ZFS and ext4 across our infrastructure in European data centres (Poland). We've spent hundreds of hours benchmarking both in production hosting workloads. Here's what we've learned.
Why We Run ZFS on Our Hosting Nodes
ZFS isn't new โ it was developed by Sun Microsystems in 2005 โ but it's become the filesystem of choice for serious hosting infrastructure. Here's why we use it as the primary filesystem on our storage and hypervisor nodes:
1. Instant Snapshots for Backups
ZFS snapshots are instantaneous and nearly free. They use copy-on-write (CoW) semantics, meaning creating a 1TB volume snapshot takes milliseconds and consumes zero additional space until data changes. This makes nightly backups trivial:
# Automated hourly + daily snapshot rotation
zfs snap -r tank/vms@$(date +%Y-%m-%d-%H%M)
zfs destroy tank/vms@$(date -d '-7 days' +%Y-%m-%d-%H%M) 2>/dev/null
With ext4, you'd need LVM snapshots (which can impact performance) or third-party tools like rsync with hard links. ZFS makes backup infrastructure dramatically simpler.
2. Built-in Compression (lz4)
ZFS's lz4 compression is nearly free in CPU terms while delivering meaningful space savings:
| Workload | Compression Ratio | Effective Space Saving |
|---|---|---|
| VM disk images (raw/qcow2) | 1.3x - 1.8x | 23-44% |
| WordPress sites (HTML, PHP, DB) | 2.1x - 3.4x | 52-71% |
| Database files (MariaDB/MySQL) | 1.5x - 2.8x | 33-64% |
| Log files | 4.5x - 8.2x | 78-88% |
The CPU overhead of lz4 is typically less than 2% of a modern Xeon or EPYC core, making it essentially free for most workloads.
3. ARC Caching for Hot Data
ZFS's Adaptive Replacement Cache (ARC) is an intelligent read cache that adapts to your workload. It keeps frequently accessed data in RAM, reducing disk I/O. In our benchmarks, ARC reduced read latency by 40-60% for WordPress hosting workloads.
The ARC uses a sophisticated algorithm that tracks both recency and frequency, outperforming the simpler LRU (Least Recently Used) cache used by traditional filesystems.
4. Data Integrity with Checksumming
Every block written to a ZFS filesystem is checksummed. When it's read, ZFS verifies the checksum. If corruption is detected (from bit rot, phantom writes, or hardware errors), ZFS automatically repairs from parity if you're using RAID-Z or mirroring.
This is critical for hosting workloads where data corruption could mean lost customer data. Ext4 has no built-in checksumming โ you'd need to run fsck manually.
When ext4 Still Wins
Despite ZFS's advantages, ext4 isn't obsolete. Here's where it still shines:
1. Raw Performance (Sequential I/O)
In pure sequential read/write benchmarks, ext4 consistently outperforms ZFS by 5-15%. This matters for workloads like:
- Video streaming servers (large sequential reads)
- Log shipping and data warehousing (sequential writes)
- High-frequency trading (microsecond-level latency matters)
2. Memory Footprint
ZFS's ARC can consume significant RAM โ by default it uses up to 50% of system memory. On memory-constrained hosts (under 32GB), this can impact application performance. Ext4 has near-zero memory overhead.
3. Simplicity for Simple Use Cases
For a single disk with basic partitioning, ext4 is trivially simple:
# ext4 setup
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mnt/data
# ZFS setup
zpool create tank /dev/sda1
zfs create tank/data
zfs set mountpoint=/mnt/data tank/data
ZFS adds another layer of complexity โ pools, datasets, properties โ that requires training and careful management.
Our Benchmark Results
We ran comprehensive benchmarks on identical hardware (2x AMD EPYC 7443, 256GB RAM, 4x Samsung PM9A3 NVMe in striped mirror config):
| Benchmark | ext4 | ZFS (lz4, ARC=16GB) | ZFS (no compression) |
|---|---|---|---|
| Sequential Read (4M blocks) | 5,842 MB/s | 5,211 MB/s | 5,389 MB/s |
| Sequential Write (4M blocks) | 3,912 MB/s | 3,443 MB/s | 3,621 MB/s |
| Random Read 4K (IOPS) | 1,234,000 | 1,892,000 | 1,456,000 |
| Random Write 4K (IOPS) | 842,000 | 967,000 | 712,000 |
| WordPress page load (50 concurrent) | 312ms avg | 198ms avg | 287ms avg |
| MariaDB TPS (sysbench OLTP) | 12,450 | 15,832 | 13,210 |
| Snapshot creation (1TB volume) | N/A (LVM: 45s) | <1s | N/A |
Our Hybrid Approach
We don't choose one or the other. We use both where they excel:
- ZFS on hypervisor nodes โ VM disk images, snapshots, backups. The snapshot and compression features save terabytes of storage.
- ZFS on storage nodes โ Customer backups, database dumps, VM templates. Data integrity checksumming is critical here.
- ext4 on compute nodes โ Where raw sequential throughput matters and we have ECC RAM covering data integrity.
- ext4 on boot volumes โ Simple, reliable, minimal overhead for the OS root filesystem.
Management Overhead
It's worth addressing the elephant in the room: ZFS requires more expertise to manage. Key operational considerations:
- zpool monitoring: Check pool health, scrub status, and capacity daily
- ARC sizing: Tune the ARC to avoid starving applications of memory
- Scrubbing: Regular scrubs (weekly for metadata, monthly for data) verify checksums
- Capacity planning: ZFS performance degrades when pools exceed 80% fill
However, with modern management tooling (our storage manager handles most of this automatically), the operational burden is minimal.
Conclusion
For hosting workloads, ZFS is the superior choice in most scenarios. The combination of instant snapshots, transparent compression, intelligent caching, and data integrity checksums provides features that ext4 simply can't match.
That said, ext4 remains a perfectly valid choice for specific use cases where simplicity and raw sequential throughput are paramount. The best infrastructure teams use both, choosing the right tool for each job.
At Hostingowy, all our VPS and dedicated server plans run on ZFS-backed storage, giving you built-in snapshot backups, compression, and data integrity at no extra cost.