[MDEV-16509] MariaDB 10.1+ with wsrep_on=ON performs better when log_bin is enabled Created: 2018-06-18 Updated: 2023-12-22 Resolved: 2019-03-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Galera |
| Affects Version/s: | 10.1.34 |
| Fix Version/s: | 10.4.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Valerii Kravchuk | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | performance, regression, wsrep | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Galera clusters do not necessary need binary logging enabled on nodes, so configuration with binary logging disabled is quite common. It turned out that after upgrade to 10.1.x, these configurations started to perform worse, as notable time is spent on keeping tc.log updates (in pre-10.1 versions tc.log was not maintained in such cases, see Simple sysbench tests may show this effect. For example, I've prepared the following table on my 2 cores old netbook running under Ubuntu 14.04:
Then I started single node cluster on the same datadir with the following command (all defaults unless specified):
and the run sysbench test with N concurrent threads, where N in (4,8,16):
I've got the following (low) TPS values:
Then I stopped the node and restarted it again with log_bin enabled:
I've got the following results, with TPS values still small, but notably higher:
It seems we should do something to reduce the impact of log_bin NOT specified or clearly recommend to set it explicitly in the KB articles for Galera nodes on 10.1.x+ Side node: I do NOT see the same effect without wsrep_on = ON - there without log_bin enabled we run a bit faster. |
| Comments |
| Comment by Seppo Jaakola [ 2018-11-07 ] | |||||||||||||||||
|
I did some performance benchmarks with write only load to focus only in on binlog phase of execution. Benchmarks were run against MariaDB 10.1 and 10.2 versions and for comparison, also for MySQL based 5.6 and 5.7 versions. Tests were run with my 4 core laptop, with SSD disk. My results show that there is practically no difference in performance with binlog enabled or disabled, with any of the tested MariaDB/MySQL versions, write rates varied between 600-1600/sec depending on test client count and other configuration, innodb_flush_log_at_trx_commit has highest impact on performance, overall. valerii your bechmark has probably high number of reads, but have you tested with more write intensive benchmarks? When testing with read related load, please make sure wsrep_sync_wait=0 to rule out read causality waits. | |||||||||||||||||
| Comment by Valerii Kravchuk [ 2018-11-07 ] | |||||||||||||||||
|
seppo, had you tried that exact sysbench test that I've used, with 4, 8 and 16 concurrent threads, sysbench running on the same box and single Galera node? Note that I've used default values for all variables besides those explicitly listed:
wsrep_sync_wait is 0 by default and probably should not matter for a single node setup. These tests were run on an old and slow laptop, 2 cores, HDD. Surely TPS rate is too low. But the difference with log_bin=1 was very obvious as long as have wsrep_on=1. I can surely repeat them again or try to find better hardware (no SSD here, sorry), but I'd like to see your results for literally the same test, first. | |||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2018-11-20 ] | |||||||||||||||||
|
Tested with mariadb-10.1.38 and sysbench 1.0.15 using my laptop with Debian and SSD.
Based on this there is clear difference is log_bin set or not. This is only single node performance so not much to say about e.g. 3 node galera cluster. | |||||||||||||||||
| Comment by Ranjan Ghosh [ 2018-12-02 ] | |||||||||||||||||
|
log_bin=default seems a bit misleading to me. The default is: No log bin. If you specify log_bin=default then it means: log_bin with a filename called "default", same with "log_bin=1". Sorry for the nitpicking, but I just wanted to make crystal clear what's going on. Interestingly, as I already wrote under (possible duplicate?) I'm using MariaDB 10.3.11, btw. According to | |||||||||||||||||
| Comment by Seppo Jaakola [ 2018-12-19 ] | |||||||||||||||||
|
My results with: TPS rate with binlog: TPS rate without binlog Sysbench OLTP test does ~25% writes, so most the test execution does not test binlogging at all | |||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2019-01-25 ] | |||||||||||||||||
|
Tested this again with
Server started by:
sysbench: sysbench 1.0.15-49f1757 (using bundled LuaJIT 2.1.0-beta2)
After this I shutdown server and restart
Still seeing clear difference between default setting and log-bin setting:
| |||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2019-03-06 ] | |||||||||||||||||
|
Is the performance difference caused by the fact that MariaDB has to use the memory-mapped file-based transaction coordinator log (i.e. tc.log) when the binary log is disabled? i.e. see I documented the following here:
https://mariadb.com/kb/en/library/transaction-coordinator-log-overview/#mariadb-galera-cluster | |||||||||||||||||
| Comment by Julien Fritsch [ 2020-12-03 ] | |||||||||||||||||
|
Found in disabled.def for ES that it was disabled, also I'm adding the missing label. |