--source include/have_rocksdb.inc --source include/have_log_bin.inc #--source include/have_binlog_format_row.inc --echo # Disable for valgrind because this takes too long --source include/not_valgrind.inc --disable_warnings DROP DATABASE IF EXISTS mysqlslap; --enable_warnings set binlog_format=row; set global binlog_format=row; SET @save_rfl= @@rocksdb_flush_log_at_trx_commit; SET GLOBAL rocksdb_flush_log_at_trx_commit=1; set global sync_binlog=1; let $using_mariadb= `select @@version like '%mariadb%'`; let $using_fbmysql= `select @@version not like '%mariadb%'`; CREATE DATABASE mysqlslap; USE mysqlslap; CREATE TABLE t1(id BIGINT AUTO_INCREMENT, value BIGINT, PRIMARY KEY(id)) ENGINE=rocksdb; select @@rocksdb_flush_log_at_trx_commit; select @@sync_binlog; select @@log_bin; if ($using_fbmysql) { echo TH CONCURRENCY QUERIES TIME QPS WSYNCS WSYNCED Binlog_bytes Binlog_fsync ; } if ($using_mariadb) { echo TH CONCURRENCY QUERIES TIME QPS WSYNCS WSYNCED Binlog_bytes Binlog_commits Binlog_group_commits ; } let $cnt=4; let $queries=5000; while ($cnt < 200) { --disable_query_log truncate table t1; select variable_value into @c from information_schema.global_status where variable_name='rocksdb_wal_group_syncs'; select variable_value into @d from information_schema.global_status where variable_name='rocksdb_wal_synced'; select variable_value into @e from information_schema.global_status where variable_name='rocksdb_wal_bytes'; select variable_value into @bbw from information_schema.global_status where variable_name='Binlog_bytes_written'; if ($using_fbmysql) { select variable_value into @bfc from information_schema.global_status where variable_name='Binlog_fsync_count'; } if ($using_mariadb) { select variable_value into @bc from information_schema.global_status where variable_name='Binlog_commits'; select variable_value into @bgc from information_schema.global_status where variable_name='Binlog_group_commits'; } set @ts1=now(6); --enable_query_log #--echo # THIS IS: --concurrency=$cnt --number-of-queries=1000 --exec $MYSQL_SLAP --silent --concurrency=$cnt --number-of-queries=$queries --query="INSERT INTO t1 (id, value) VALUES(NULL, 1)" --disable_query_log set @ts2=now(6); select variable_value-@c into @a_ROCKSDB_WAL_GROUP_SYNCS from information_schema.global_status where variable_name='rocksdb_wal_group_syncs'; select variable_value-@d into @a_ROCKSDB_WAL_SYNCED from information_schema.global_status where variable_name='rocksdb_wal_synced'; select variable_value-@e into @a_ROCKSDB_WAL_BYTES from information_schema.global_status where variable_name='rocksdb_wal_bytes'; select variable_value- @bbw into @a_bbw from information_schema.global_status where variable_name='Binlog_bytes_written'; if ($using_fbmysql) { select variable_value- @bfc into @a_bfc from information_schema.global_status where variable_name='Binlog_fsync_count'; } if ($using_mariadb) { select variable_value- @bc into @a_bc from information_schema.global_status where variable_name='Binlog_commits'; select variable_value- @bgc into @a_bgc from information_schema.global_status where variable_name='Binlog_group_commits'; } --enable_query_log let $ts_diff= `select timestampdiff(microsecond, @ts1, @ts2) / 1000000.0`; #select timestampdiff(microsecond, @ts1, @ts2) / 1000000.0; let $qps = `select $queries / $ts_diff`; let $grp_syncs= `select @a_ROCKSDB_WAL_GROUP_SYNCS`; let $synced= `select @a_ROCKSDB_WAL_SYNCED`; let $bbw=`select @a_bbw`; if ($using_fbmysql) { let $bfc=`select @a_bfc`; } if ($using_mariadb) { let $bc=`select @a_bc`; let $bgc=`select @a_bgc`; } #select @ts_diff as 'TIME'; #select 1000 / @ts_diff as 'QPS'; if ($using_fbmysql) { #--echo TH CONCURRENCY QUERIES TIME QPS WSYNCS WSYNCED Binlog_bytes Binlog_fsync echo TR $cnt $queries $ts_diff $qps $grp_syncs $synced $bbw $bfc; } if ($using_mariadb) { #--echo TH CONCURRENCY QUERIES TIME QPS WSYNCS WSYNCED Binlog_bytes Binlog_commits Binlog_group_commits echo TR $cnt $queries $ts_diff $qps $grp_syncs $synced $bbw $bc $bgc; } # show status like 'queries'; let cnt= `select $cnt * 2`; } --disable_parsing --echo ## --echo ## Concurrency=1, 1K queries --echo ## --enable_parsing set global sync_binlog=default; DROP TABLE t1; DROP DATABASE mysqlslap; SET GLOBAL rocksdb_flush_log_at_trx_commit=@save_rfl; set binlog_format=default; set global binlog_format=default;