Product

How it works Features Performance Screenshots Docs Security Questions

Start here

Getting started Download The manual Frequently asked questions

More

Security Performance Source

Performance

Both servers, measured on the same three machines, with the same workload, one wiped and rebuilt into the other in between. Numbers from a real cluster, not estimates.

Which one is faster

MariaDB, on this workload, by a wide margin. Tuned first, best first, then the same two servers as their installers leave them. Tuned means the settings made to match, so that the two are doing the same amount of work.

ServerPeak a secondReadsInserts ProcessorsDisk busy
MariaDB - Tuned21,556 10,7723,23261%1%
MySQL - Tuned13,0326,514 1,95575%4%
MariaDB, as the installer leaves it21,34310,677 3,20860%1%
MySQL, as the installer leaves it5,1742,588 77750%50%

On level settings MariaDB does 65 percent more work, and it does it using less of the machine: 61 percent of the processors against 75, and almost no disk at all. That is the number to plan around if throughput is what you are choosing on.

Worth knowing

Speed is not the only difference. MySQL here means Percona, which encrypts what the nodes say to each other and keeps a binary log, so it can do point in time recovery. The MariaDB build does neither. Part of what looks like MariaDB winning is MariaDB doing less.

What the binary log costs

The two installers leave different durability settings, and it is worth two and a half times the throughput. MySQL ships with the binary log on and an fsync on every commit. MariaDB ships with it off. Nothing else changed between these two rows.

MySQLPeak a secondWrite p95 Disk busyDisk written
Binary log on, fsync per commit5,174776 ms 50%23 MB/s
Binary log off13,03221.9 ms 4%12 MB/s

Look at the last two columns rather than the first. With the log on, the disk was half busy moving twice the data at half the speed, and the processors sat idle at 50 percent. That is the shape of many small forced flushes, not of a disk running out of room to move. Turn it off and the disk drops to 4 percent busy and the processors finally become the thing in the way.

Galera does not need the binary log to replicate. It needs it to rebuild the database to a point in time after somebody drops the wrong table. So this is a real choice and not free either way, and it is the first thing to look at if writes are slower than expected.

Queries, inserts and drops

Broken out, because they cost different amounts. An insert appends. An update has to find the row first and then send the old and new values to every node. A drop is DDL, which the cluster runs one statement at a time in agreed order.

A secondMariaDB - TunedMySQL - Tuned
Queries10,7726,514
Inserts3,2321,955
Updates6,4743,913
Deletes1,078649
CREATE TABLE29280
DROP TABLE324117
DROP TABLE, 200,000 rows in it33 to 30028

MariaDB is about four times faster at DDL. That gap holds across every run, and it matters more than it looks: DDL stops the cluster while it happens, so a migration that creates and drops a few hundred tables is a few hundred short pauses on one server and a quarter as many on the other.

The last row is a range on purpose. Dropping a populated table took 3.3 ms on an idle cluster and 30.7 ms on one still settling after a long run, and both readings are real. Quoting either end alone would be picking a favorite.

Reads alone

Take the writes away and the picture changes completely. MariaDB served 56,079 reads a second at 96 connections, more than twice the whole mixed figure.

That is because a read never leaves the machine it arrives on. It is not sent to the other nodes, nothing has to agree to it, and no write set is certified. So reads scale with the hardware instead of with the cluster, and this is the one test where the machine actually ran out: the processors hit 99.8 percent while the disk stayed at zero.

Worth knowing when sizing. If your load is mostly reads, buy processors. If it is mostly writes, more processors will not help, because the limit is agreement between nodes.

Where the curve bends

Both servers reach their peak at 96 connections across three nodes and then slowly get worse. There is no climb to look for. A Galera cluster hits its limit almost at once, and every connection after that is waiting rather than working.

ConnectionsMariaDB a secondWrite p95 MySQL a secondWrite p95
9621,55612.5 ms13,03221.9 ms
19220,24427.7 ms12,59943.9 ms
38419,33957.8 ms12,73185.7 ms
76818,287120.7 ms12,232177.8 ms
1,53617,336246.7 ms11,553378.5 ms

Read the two p95 columns down the page. Sixteen times the connections buys nothing at all and costs twenty times the wait. The work per second is fixed, so every extra connection just joins a longer line.

Careful

The instinct when an application is slow is to raise the connection pool. Past the bend that makes it worse. Fewer connections each doing more is the fix.

The default that stops MariaDB early

MariaDB is left at max_connections = 151, which is the stock default. Ask for more than that and the extra connections are refused. It does not cost throughput, because 96 connections is already past the bend, but it is a wall and it arrives without warning. The MySQL installer sets 2,000 and MariaDB's does not.

Raise it before you need it:

sudo mariadb -e "SET GLOBAL max_connections = 2000"

That lasts until the server restarts. To keep it, put max_connections = 2000 under [mysqld] in a file in /etc/mysql/mysqlcluster.conf.d/.

Two things measured earlier

These come from testing in August on a different arrangement of machines, with an older version of the workload. They are kept because the questions they answer still matter, and they are separated out because the numbers cannot be lined up against the tables above. Read them as ratios, not as totals.

ArrangementPeakDifference
Three nodes in one data center 20,968 a secondthe baseline
Two local, one about 2,000 miles away 14,613 a second30% lower

Distance costs about a third of the write throughput, because every commit waits for the far node. It buys surviving the loss of a whole site. Whether that is worth it is a question about your business rather than about the database.

With a 20 GB table against a 9.3 GB buffer pool, a mixed workload ran at about half the speed of one that fits, and reads alone lost about 30 percent. On NVMe, running a little over the buffer pool costs throughput steadily rather than falling off a cliff. Aim to fit the working set in memory; a little over still works.

How big should the machines be

Data sizeMemoryProcessorsDisk
Under 5 GB8 GB2SSD
5 to 20 GB16 GB4NVMe
20 to 80 GB64 GB8NVMe
Over 80 GBEnough for the working set16NVMe

All three machines the same size: the cluster runs at the speed of its slowest member, because every node applies every write.

Neither server ran out of memory or processors in any of these runs. Memory never went above 4.8 GB of 15.5, and the busiest the processors got was 75 percent. What runs out first in a Galera cluster is agreement between the nodes, not hardware.

How this was measured

WhatHow
MachinesThree KVM guests, 4 processors, 15,475 MB, virtual disk on host NVMe, one data center
ServersPercona XtraDB Cluster 8.0.46 against MariaDB 11.4.5 with Galera 26.4.24
Data1,476,251 rows, seeded fresh before every run, inside the buffer pool
WorkloadHalf reads. Of the writes, 60% updates, 30% inserts, 10% deletes
Steps200 seconds each at 96, 192, 384, 768 and 1,536 connections
DriverAll three nodes at once, each against its own server
Run to run spread3.4%, from running the same test twice

Every read and every update lands on a real row. Galera steps the id column by the cluster size, so ids are not dense, and picking a random id finds nothing more often than it finds something. Updates that match no row are nearly free, which makes a cluster look faster than it is. The test seeks to the next real row instead.

One workload, small rows, primary key access, everything in memory. It says nothing about joins, table scans, or a database larger than the memory you give it.

Measure your own

The Utilization page shows all of this for your cluster, live.