MariaDB

MariaDB, tuned to the max

Every WordPress page, order and search result comes from the database. That is why we tune our MariaDB databases to the server's memory and UpCloud's MaxIOPS disks - and keep monitoring their performance.

Technology

Why the database matters

The database is the heart of WordPress

Pages, settings, users, orders and plugin data - all WordPress content lives in the database.

When a page cannot be served ready-made from cache, WordPress runs dozens or hundreds of database queries. A database on default settings reads the data from disk again and again - a tuned database answers from memory.

Online store orders

WooCommerce products, stock levels, orders and customers all live in the database. A fast database keeps the checkout smooth during campaigns too.

The dashboard

WordPress admin runs many database queries and cannot be cached. A tuned database feels directly like a faster admin.

Searches and filters

Site search and product filters are always built fresh. Their speed depends directly on the database.

Heavy plugins

Page builders, membership and course plugins and statistics store a lot of data. Tables kept in memory handle the load.

Imports and updates

Product imports, stock updates and scheduled tasks write a lot to the database. The disks' speed is put to full use.

Many sites on one server

Per-account connection limits stop any single site from taking all database connections for itself.

How we tune it

Memory, disks and continuous monitoring

Default settings are made to work everywhere - our settings are made to work on our servers.

Each server's database settings are sized to its memory and storage, and refined based on real use.

We size the memory

The database buffer pool, table caches and connection limits are sized to the server's memory - the largest servers have an 8 GB buffer pool.

We use the disks' full speed

We tell the database how fast UpCloud's MaxIOPS disks are, so it can use their full performance.

We monitor and adjust

We analyse database behaviour regularly with MySQLTuner and adjust the settings to real use.

MaxIOPS disks

UpCloud MaxIOPS disks at full power

UpCloud's MaxIOPS storage is among the fastest in Europe - but on default settings the database would use only a fraction of it.

The database defaults are sized for old spinning hard drives. We tell MariaDB the disks' real speed, turn off optimisations meant for slow disks and skip the operating system's needless caching layer.

innodb_io_capacity 2000-4000

The database may write to disk thousands of times per second, as fast storage allows.

innodb_flush_neighbors 0

Neighbour-page flushing made for spinning disks is off - on fast disks it only gets in the way.

O_DIRECT

Data is written straight to disk without the operating system cache, so the same data is not kept in memory twice.

Our settings

Data and indexes stay in memory

The most effective way to speed up database queries is to never need to read from disk at all.

That is why most of our tuning is about memory. Here are the key settings - the values are matched to each server's memory.

MariaDB

innodb_buffer_pool_size

The buffer pool keeps the most used tables and indexes in memory - from 512 MB on small servers to 8 GB on large ones.

innodb_log_file_size

A large log file (up to 2 GB) evens out writes, so even heavy imports and updates run without stutter.

table_open_cache

Up to 4,000 open tables stay ready, so the tables of many WordPress sites do not have to be reopened all the time.

tmp_table_size

Temporary tables for sorting and grouping (64 MB) are built in memory, not on disk.

thread_cache_size

Connection threads are reused, so a page load does not have to open a connection from scratch.

max_user_connections

A single account may only use part of the server's database connections, so one site cannot block the database for others.

Benefits

Faster, steadier, more reliable

Fast queries

Data and indexes are answered from memory instead of disk.

Disks at full speed

The speed of MaxIOPS disks is used fully for writes.

Fair limits

Connection limits stop one site from blocking the database for others.

Tuned for you

Settings are sized and refined for you - at no extra cost.

Availability

Which services use this?

Tuned MariaDB databases are standard in all our WordPress services and cloud servers.

There is nothing for you to adjust - the settings are already sized for each server.

WP, SmartWP and SmartWoo

WordPress hosting

Tuned MariaDB, MaxIOPS disks and fair connection limits in every plan.

WP hosting

Managed Cloud 3.0

Your own server

The database is sized to your server's memory, and the settings can be refined to your needs.

Managed Cloud 3.0

Reseller Cloud 3.0

For agencies

The same tuned database for all your client sites - connection limits keep clients apart.

Reseller Cloud 3.0

MariaDB is a registered trademark of MariaDB plc. It is used on this page for referential purposes only. Logo: Wikimedia Commons, GPL licence.

Honestly

What database tuning does not do for you

Does not fix bad queries

If a plugin runs heavy queries without indexes, even a fast database will not remove the problem. We can help find the slow queries.

Does not replace an object cache

WordPress asks the same things over and over. Redis object cache saves those queries entirely - the tuned database answers the rest quickly.

Does not replace backups

Speed and safety are different things. Databases are backed up daily with the server backups.

FAQ

Questions about MariaDB

MariaDB is an open-source database server continued by the original MySQL developers. It is MySQL-compatible, so WordPress and its plugins work on it as is.

No. MariaDB's old query cache is off by default, as it slows down busy servers. A more effective way is to keep data and indexes in memory in the InnoDB buffer pool - and for WordPress, to save repeated queries entirely with Redis object cache.

We write the transaction log to the operating system on every change and to disk once per second. A database service crash therefore loses no data. Only a sudden shutdown of the whole server could lose at most about a second of changes - and the cloud infrastructure's fault tolerance and daily backups protect against exactly that kind of situation.

MySQLTuner is an established analysis tool that goes through database usage statistics and shows which settings are worth changing. We use it regularly to refine our servers' settings.

Yes. On a Managed Cloud server the settings are sized to the server's memory, and we refine them to your applications' load when needed.

Connection limits stop a single account from taking all of the server's database connections, and the large buffer pool keeps the most used data available for every site.

See also

More technology from Hostaan

A fast database for every WordPress site

Tuned MariaDB, MaxIOPS disks and Redis object cache make WordPress fast even where the page cache cannot reach.

See WP hosting