Group commit in MariaDB is fast

By Mark Callaghan on Thursday, June 23, 2011 at 8:10am

The 5.3 branch for MariaDB has group commit. Kristian Nielsen has written several posts about it. I think it has also been ported to Percona XtraDB so at this point we have consensus that Kristian's work is the solution. The Facebook patch has an earlier and different implementation of group commit. The version published in the Facebook patch has bugs that I recently fixed so I ran performance tests to compare MariaDB 5.3 with the Facebook patch.

 

Group commit in MariaDB 5.3 is fast and much faster than in the Facebook patch using MySQL 5.1.52. Given that official MySQL doesn't have group commit both MariaDB and the Facebook patch are much faster than it whenever group commit is possible. I used sysbench and a workload that updated one row per transaction using 1 to 1024 concurrent connections and a table with 1M rows. The table was cached in the InnoDB buffer pool. The binlog was enabled. The test server has a HW RAID card. One set of tests was run with the battery-backed write cache enabled and fsync latency was less than 400 microseconds. Another set of tests was run with the battery-backed write cache disabled and fsync latency was several milliseconds.

 

Fast fsync

 

This plots the commit rate for 1 to 1024 concurrent connections for a server with ~400 microsecond fsync latency. Group commit for the Facebook patch was enabled whenever there were at least 33 concurrent commit attempts so the benefit should not begin until 64 concurrent connections were used. The MariaDB implementation is able to do group commit at lower concurrency levels. That was not possible in the Facebook patch when fsync latency is low. But the MariaDB implementation also does much better at high-concurrency levels. The results are impressive.

 

 

Slow fsync

 

This plots the commit rate for 1 to 1024 concurrent connections for a server with fsync latency that exceeds 4 milliseconds. Group commit for the Facebook patch was enabled whenever there were at least 2 concurrent commit attempts. Group commit makes a big difference in this case and will help servers that lack a battery-backed write cache, use network attached storage or have dead batteries in a battery-backed write cache.