XFS vs Ext4 performance

I wanted to test XFS vs Ext4 performance, so I created two partitions /dev/mapper/vg_hv1-lv_vm1 which is xfs based and /dev/mapper/vg_hv1-lv_vm2 which is ext4 based. Both partitions are on a single RAID-1 disk.

[hv ~]$ sudo hdparm -Tt /dev/mapper/vg_hv1-lv_vm1

/dev/mapper/vg_hv1-lv_vm1:
Timing cached reads: 24786 MB in 2.00 seconds = 12413.11 MB/sec
Timing buffered disk reads: 370 MB in 3.01 seconds = 123.01 MB/sec
[hv ~]$ sudo hdparm -Tt /dev/mapper/vg_hv1-lv_vm1

/dev/mapper/vg_hv1-lv_vm1:
Timing cached reads: 24602 MB in 2.00 seconds = 12320.66 MB/sec
Timing buffered disk reads: 366 MB in 3.00 seconds = 121.80 MB/sec
[hv ~]$ sudo hdparm -Tt /dev/mapper/vg_hv1-lv_vm1

/dev/mapper/vg_hv1-lv_vm1:
Timing cached reads: 24300 MB in 2.00 seconds = 12169.27 MB/sec
Timing buffered disk reads: 374 MB in 3.01 seconds = 124.37 MB/sec
[hv ~]$ sudo hdparm -Tt /dev/mapper/vg_hv1-lv_vm2

/dev/mapper/vg_hv1-lv_vm2:
Timing cached reads: 24566 MB in 2.00 seconds = 12302.76 MB/sec
Timing buffered disk reads: 392 MB in 3.01 seconds = 130.37 MB/sec
[hv ~]$ sudo hdparm -Tt /dev/mapper/vg_hv1-lv_vm2

/dev/mapper/vg_hv1-lv_vm2:
Timing cached reads: 24576 MB in 2.00 seconds = 12307.80 MB/sec
Timing buffered disk reads: 366 MB in 3.01 seconds = 121.42 MB/sec
[hv ~]$ sudo hdparm -Tt /dev/mapper/vg_hv1-lv_vm2

/dev/mapper/vg_hv1-lv_vm2:
Timing cached reads: 24322 MB in 2.00 seconds = 12180.78 MB/sec
Timing buffered disk reads: 396 MB in 3.01 seconds = 131.41 MB/sec

I would expect the timing cached reads results to be very similar, since timining cached reads is a measure of processor, cache and memory. Timing cached reads basically reads from the Linux buffer cache without disk access.

The timing buffered disk read on the other hand flushes the Linux buffer caches and reads through it directly from the disk. These numbers were also very similar.

I was hoping that dd numbers would be significantly different for XFS and Ext4, but as you can see below there is minimal difference in the write operations:
[hv ~]$ sudo dd bs=1M count=128 if=/dev/zero of=/vm1/test conv=fdatasync
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 1.12586 s, 119 MB/s
[hv ~]$ sudo dd bs=1M count=128 if=/dev/zero of=/vm1/test conv=fdatasync
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 1.12256 s, 120 MB/s
[hv ~]$ sudo dd bs=1M count=128 if=/dev/zero of=/vm1/test conv=fdatasync
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 1.15067 s, 117 MB/s
[hv ~]$ sudo dd bs=1M count=128 if=/dev/zero of=/vm1/test conv=fdatasync
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 1.13103 s, 119 MB/s
[hv ~]$ sudo dd bs=1M count=128 if=/dev/zero of=/vm2/test conv=fdatasync
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 1.18037 s, 114 MB/s
[hv ~]$ sudo dd bs=1M count=128 if=/dev/zero of=/vm2/test conv=fdatasync
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 1.09832 s, 122 MB/s
[hv ~]$ sudo dd bs=1M count=128 if=/dev/zero of=/vm2/test conv=fdatasync
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 1.10921 s, 121 MB/s

The fdatasync option to dd tells dd to physically write output file data before finishing, which is a more realistic approach for testing. What are your thoughts on the above results?

One thought on “XFS vs Ext4 performance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s