Tuesday, September 13, 2011

Benchmarking ZFS, XFS, ext4 and btrfs with PostgreSQL 9.0 and 9.1

Benchmarking ZFS, XFS, ext4 and btrfs with PostgreSQL 9.0 and 9.1

A while ago I posted the results of benchmarking PostgreSQL against various filesystems, with various mount options.
Today I've run ZFS up against the PostgreSQL benchmark, along with btrfs, ext4 and xfs.

I ran the results on Ubuntu 11.04 with Pg 9.0 and Ubuntu 11.10 beta with Pg 9.1. In the following results, the first combo is called "natty" and the second one "oneiric".

The latter combination showed a considerable performance improvement overall - although I didn't investigate to find out whether this was due to kernel improvements, postgres improvements, or virtio improvements. (Since I was running these tests in a virtual machine, albeit one backed by striped RAID disks with caching disabled in KVM).

The results are measured in transactions-per-second, with higher numbers being better.

ext4 (data=writeback,relatime):
    natty: 248
  oneiric: 297

ext4 (data=writeback,relatime,nobarrier):
    natty: didn't test
  oneiric: 1409

xfs (relatime):
    natty: didn't test
  oneiric: 171

btrfs (relatime):
    natty: 61.5
  oneiric: 91

btrfs (relatime,nodatacow):
    natty: didn't test
  oneiric: 128

zfs (defaults):
    natty: 171
  oneiric: 996


Conclusion:
Last time I ran these tests, xfs and ext4 pulled very similar results, and both were miles ahead of btrfs. This time around, ext4 has managed to get a significantly faster result than xfs. However we have a new contender - ZFS performed extremely well on the latest Ubuntu setup - achieving triple the performance of regular ext4!
I am suspicious that ZFS may not be using any "barrier" coding though - and if ext4 has those disabled, it surpasses even ZFSs high score. Or maybe it's because ZFS (according to Wikipedia) will enable the write caching on drives and then uses a write system that is supposedly safe against failures?

Oddly, ZFS performed wildly differently on ubuntu 11.04 vs 11.10b. I can't explain this. Any ideas?

Cheers,
Toby

Calculate billionth birth-seconds

A while ago Ingy döt Net introduced me to the concept of the billionth birth-second.
This is a celebration of when your lifespan reaches one billion seconds since birth.

I have created a website to help people easily calculate when this occurs, which is here:
Calculate your billionth birth-second

If you're interested, the source code is available here:
https://github.com/TJC/calculate-birthsecond