[MySQL Patch] Binlog文件预分配

2014-11-24 18:51:22 · 作者: · 浏览: 0

一组简单的测试数据,之前我在percona-discuess 上发过,直接拿过来了...


my test: (using mysqlslap, ext3 filesystem)
set sync_binlog = 1



create a simple table:
create table xxx (a int auto_increment, b int, c varchar(50), primary key(a))



mysqlslap --no-defaults -uxx --create-schema=test --number-of-queries=2000000 --concurrency=$i -S $sock --query="insert into xxx values (NULL,2, 'sadasda')"


threads with binlog-prealloc Original version
10 152s 455s
30 104s 216s
50 97s 164s
70 98s 143s
90 98s 132s
110 101s 127s
130 102s 124s
150 104s 123s


以下Patch基于Percona Server5.5.24,目前处于测试中,比较简陋...


cmake时需要增加选项 -DWITH_BINLOG_PREALLOC=ON


然后 install plugin:
set binlog_prealloc = 1;
install plugin binlog_prealloc soname 'libbinlog_prealloc.so';
flush logs;