Testing EXT4 & Btrfs On A Serial ATA 3.0 SSD
Btrfs remains very slow with handling the PostgreSQL workload, with the default EXT4 file-system being several times faster. There is an "autodefrag" mount option that was introduced in the Linux 3.0 kernel for Btrfs that will detect random writes into existing files and then start a background de-fragging process, which is said to help with some databases (namely SQLite), but not for virtualization images or big databases. This mount option will be tested in a future article to see if it has any noticeable impact on the PostgreSQL performance. The Btrfs mount option that helped the most for this test was the space_cache option with the number of database transactions per second going up significantly.
Yep, SQLite is very bad on Btrfs, except the space_cache mount option did improve the performance several fold. Even with the space_cache option, Btrfs was noticeably slower than EXT4 for this simple test, but the "autodefrag" option may help here.
On the Serial ATA 3.0 SSD, Btrfs was slower than EXT4. The only mount option that caused a great deal of difference for this mail server benchmark was using Zlib compression, which increased the performance by more than three fold.