CFQ vs Deadline Benchmarking
In this investigation we compare the CFQ and Deadline I/O schedulers with a mix of different
standard tests on HDD and SSD.
Tests run on a 4 core hyperthreaded Intel Ivybridge SDP running Quantal 3.4.0-5-generic-x86_64.
The HDD was a Western Digital WD5000AAKX HDD (7200 rpm, 16MB cache) and the SSD was an
Intel 330.
Results
Summary
Bonnie
- HDD:
- Throughput on ext2, xfs and btrfs is best with Deadline scheduler
- ext3 best with CFQ
- ext4 mixed results
- CFQ best for random seeks across most file systems
- SSD: Deadline is generally as good as or better than CFQ on most filesystems on a SSD
Postmark
- HDD: CFQ best choice for ext2, otherwise CFQ and Deadline almost identical for ext3, ext4, xfs and btrfs
- SSD: CFQ best choice for ext2, ext3 and ext4, otherwise Deadline best xfs and btrfs
Tiobench
- HDD:
- Generally Deadline consumes more CPU with random read/writes with high thread counts.
- Comparable CPU loading for CFQ and Deadline for sequential writes.
- Comparable latencies for CFQ and Deadline for random reads and sequential reads and writes.
- Mostly higher random read and write transfer rates with Deadline.
- Higher sequential read rates with CFQ.
- Higher sequential write rates with Deadline.
- SSD:
- Hard to spot any overally random read/write CPU load trends.
- Comparable latencies for CFQ and Deadline for random reads and sequential reads and writes.
- Higher random and sequential read rates with Deadline.
- Generally higher random write writes with Deadline.
Overall..
- So, for low-latency fast media like SSD, Deadline is a good choice
- Deadline can consume more CPU with high threadcount than CFQ.
- For HDD CFQ vs Deadline is difficult to generalise, but it does seem CFQ favours reads and Deadline favours writes.
- Chosing Deadline for HDD won't lose you much performance over CFQ.
- I/O scheduler choice depends on use case - no clear winner, difficult to say which is best in general terms.