I am running an application which inserts a lot of rows and we were experiencing some low performance. So i started benchmarking the Galera Cluster with sysbench and oltp_insert.lua (practically inserts with random key).
The performance of the cluster is really bad.
With the same test:
- As a standalone DB i can perform about 35000 tps
- With Galera multi-master the performance is: 350 tps
The table structure is this one:
Table: sbtest1
Create Table: CREATE TABLE `sbtest1` (
`id` int(11) NOT NULL,
`k` int(11) NOT NULL DEFAULT '0',
`c` char(120) NOT NULL DEFAULT '',
`pad` char(60) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `k_1` (`k`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
What i tried so far (with no success):
- increase
wsrep_slave_threads=16 - no matter how many client threads i use, the TPS is still 350 (looks like the transactions are serialized somehow by the DB)
- set
wsrep_sync_wait=0(although i perform no reads) - the db does not use binlog, its not enabled.
Configuration:
[mysqld]
binlog_format=ROW
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0
datadir=/var/lib/mysql
innodb_buffer_pool_size = 300MB
innodb_large_prefix=1
innodb_file_format=Barracuda
transaction-isolation = READ-COMMITTED
wsrep_on=ON
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_slave_threads = 16
wsrep_max_ws_rows=131072
wsrep_max_ws_size=1073741824
wsrep_convert_LOCK_to_trx=0
wsrep_causal_reads=OFF
wsrep_sst_method=xtrabackup-v2