When doing sysbench tests against standalone mysqld vs. single node Galera instance vs. two node cluster performance differs between MySQL and MariaDB setups.
With both MySQL and MariaDB standaline non-Galera nodes show best transactions per second throughput when not having to do any commit time fsync, as expected. Meaning that things are fast with innodb_flush_at_trx_commit != 1 and log_bin disabled or sync_binlog=OFF
A single node MySQL Galera setup shows almost the same numbers, is fast in the same config combinations.
A MariaDB Galera 10.x cluster, with 0 <= x <= 2 at least, shows a slightly different behavior though. Here only the combination "innodb_flush_at_trx_commit != 1, log_bin enabled, sync_binlog=OFF" is almost as fast as a standalone non-galera-enabled instance with the same "no fsync" settings. When disabling log_bin transactions per second go down quite a bit, to similar values as if innodb_flush_at_trx_commit was actually enabled.
I first suspected that group_commit might play a role, but Binlog_commits and Binlog_group_commits counters were always showing equal values in SHOW STATUS output, so this can be ruled out.
When running sysbench against a 2 node cluster performance differences were not as massive as in the single node setup, which was to be expected, but still visible.
So while turning off innodb_flush_at_trx_commit; and sync_binlog if log_bin is enabled, is usually considered safe in a cluster (if the hardware setup is redundant enough, e.g. simultaneous power failure on all nodes can be ruled out), and to improve performance/throughput a little bit, it turns out that with MariaDB the performance improvement is only visible if binlog writing is enabled, which is at least counter-intuitive.
{"report":{"fcp":895.2000000476837,"ttfb":268.5,"pageVisibility":"visible","entityId":64223,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"8bbfd83f-d9c1-430e-9af9-e27be8321c22","navigationType":0,"readyForUser":969.4000000953674,"redirectCount":0,"resourceLoadedEnd":448.2000000476837,"resourceLoadedStart":277.2999999523163,"resourceTiming":[{"duration":7.1000001430511475,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":277.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":277.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":284.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":7.200000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":277.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":277.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":284.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":154.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":277.7000000476837,"connectEnd":277.7000000476837,"connectStart":277.7000000476837,"domainLookupEnd":277.7000000476837,"domainLookupStart":277.7000000476837,"fetchStart":277.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":375.90000009536743,"responseEnd":432.10000014305115,"responseStart":388.2000000476837,"secureConnectionStart":277.7000000476837},{"duration":169.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":278.40000009536743,"connectEnd":278.40000009536743,"connectStart":278.40000009536743,"domainLookupEnd":278.40000009536743,"domainLookupStart":278.40000009536743,"fetchStart":278.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":380.40000009536743,"responseEnd":448.2000000476837,"responseStart":418.5,"secureConnectionStart":278.40000009536743},{"duration":138.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":278.60000014305115,"connectEnd":278.60000014305115,"connectStart":278.60000014305115,"domainLookupEnd":278.60000014305115,"domainLookupStart":278.60000014305115,"fetchStart":278.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":380.60000014305115,"responseEnd":416.90000009536743,"responseStart":416.2999999523163,"secureConnectionStart":278.60000014305115},{"duration":136.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":278.7999999523163,"connectEnd":278.7999999523163,"connectStart":278.7999999523163,"domainLookupEnd":278.7999999523163,"domainLookupStart":278.7999999523163,"fetchStart":278.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":377.90000009536743,"responseEnd":415.5,"responseStart":414.90000009536743,"secureConnectionStart":278.7999999523163},{"duration":108.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":278.90000009536743,"connectEnd":278.90000009536743,"connectStart":278.90000009536743,"domainLookupEnd":278.90000009536743,"domainLookupStart":278.90000009536743,"fetchStart":278.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":374.90000009536743,"responseEnd":387.5,"responseStart":386.7999999523163,"secureConnectionStart":278.90000009536743},{"duration":12.199999809265137,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":279.10000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":279.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":291.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":155.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":279.2999999523163,"connectEnd":279.2999999523163,"connectStart":279.2999999523163,"domainLookupEnd":279.2999999523163,"domainLookupStart":279.2999999523163,"fetchStart":279.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":384,"responseEnd":435.2000000476837,"responseStart":434.5,"secureConnectionStart":279.2999999523163},{"duration":13.100000143051147,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":279.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":279.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":292.60000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":138,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":279.60000014305115,"connectEnd":279.60000014305115,"connectStart":279.60000014305115,"domainLookupEnd":279.60000014305115,"domainLookupStart":279.60000014305115,"fetchStart":279.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":380,"responseEnd":417.60000014305115,"responseStart":417,"secureConnectionStart":279.60000014305115},{"duration":107,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":289.90000009536743,"connectEnd":385.2000000476837,"connectStart":385.2000000476837,"domainLookupEnd":385.2000000476837,"domainLookupStart":385.2000000476837,"fetchStart":289.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":385.2999999523163,"responseEnd":396.90000009536743,"responseStart":395.7999999523163,"secureConnectionStart":385.2000000476837},{"duration":126.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":297.7999999523163,"connectEnd":297.7999999523163,"connectStart":297.7999999523163,"domainLookupEnd":297.7999999523163,"domainLookupStart":297.7999999523163,"fetchStart":297.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":383.90000009536743,"responseEnd":424.5,"responseStart":424,"secureConnectionStart":297.7999999523163},{"duration":174.30000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":647.2999999523163,"connectEnd":647.2999999523163,"connectStart":647.2999999523163,"domainLookupEnd":647.2999999523163,"domainLookupStart":647.2999999523163,"fetchStart":647.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":788.4000000953674,"responseEnd":821.6000001430511,"responseStart":820.6000001430511,"secureConnectionStart":647.2999999523163},{"duration":140.79999995231628,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":868.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":868.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1009.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":102.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":885.7000000476837,"connectEnd":885.7000000476837,"connectStart":885.7000000476837,"domainLookupEnd":885.7000000476837,"domainLookupStart":885.7000000476837,"fetchStart":885.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":955.1000001430511,"responseEnd":988.2999999523163,"responseStart":987.7000000476837,"secureConnectionStart":885.7000000476837}],"fetchStart":0,"domainLookupStart":27,"domainLookupEnd":59,"connectStart":59,"connectEnd":88,"secureConnectionStart":69,"requestStart":88,"responseStart":268,"responseEnd":297,"domLoading":272,"domInteractive":1048,"domContentLoadedEventStart":1048,"domContentLoadedEventEnd":1098,"domComplete":1239,"loadEventStart":1240,"loadEventEnd":1240,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1015.2999999523163},{"name":"bigPipe.sidebar-id.end","time":1016.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":1016.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":1019},{"name":"activityTabFullyLoaded","time":1121.7000000476837}],"measures":[],"correlationId":"b43b06211c0092","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":118,"dbReadsTimeInMs":17,"dbConnsTimeInMs":28,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Could not reproduce it with the backup of my original test setup (may not have recovered the actual final backup of it).
With manual testing I now see it again though.
Platform: Ubuntu 18.04.1, datadir on SSD
Versions tried: 10.2.8, 10.2.19, 10.3.11
Basic single node configuration:
[mysqld]
datadir=/usr/local/mysql/var
server-id=1
wsrep_on=ON
wsrep_provider=/usr/local/mariadb-10.3.11-linux-systemd-x86_64/lib/galera/libgalera_smm.so
wsrep_cluster_name=test_cluster
wsrep_cluster_address=gcomm://192.168.23.15
wsrep_sst_method=rsync
wsrep_sst_auth=root
wsrep_node_address=192.168.23.15
wsrep_node_name=node-1
binlog-format=ROW
With just extra
[mysqld]
log-bin
using defaults for sync-binlog and innodb-flush-log-at-trx-commit I get about 90tps on all three versions.
With extra
[mysqld]
log-bin
sync-binlog=0
innodb-flush-log-at-trx-commit=0
I see a speedup to about 1000tps.
When I disable the binlog:
[mysqld]
# log-bin
sync-binlog=0
innodb-flush-log-at-trx-commit=0
I get about 250-300tps.
For running sysbench I use
mysql -h 192.168.23.15 -u root -e "drop database if exists sbtest"
mysql -h 192.168.23.15 -u root -e "create database sbtest"
/usr/bin/sysbench oltp_read_write --db-driver=mysql --mysql-host=192.168.23.15 --mysql-user=root --table_size=100000 --tables=10 --events=1000000 --threads=16 prepare
/usr/bin/sysbench oltp_read_write --db-driver=mysql --mysql-host=192.168.23.15 --mysql-user=root --table_size=100000 --tables=10 --events=1000000 --threads=16 run
/usr/bin/sysbench oltp_read_write --db-driver=mysql --mysql-host=192.168.23.15 --mysql-user=root --table_size=100000 --tables=10 --events=1000000 --threads=16 run
I'm going to attach the sysbench output for 10.3.11