SlideShare a Scribd company logo
1 of 41
Copyright 2021 Severalnines AB
2
Hello! I'm Vinay from the Severalnines Team and I'm your host for today's webinar!
Feel free to ask any questions via the Q&A chat.
You can also contact me directly via the chat box or via email:
info@severalnines.com during or after the webinar.
Björn Schiessle
Co-founder and PreSales Lead at Nextcloud
Ashraf Sharif
Senior Support Engineer at Severalnines
Our Presenters:
Welcome note
Copyright 2021 Severalnines AB
• Overview of Nextcloud architecture
• Database architecture design
• Database proxy
• MariaDB and InnoDB performance tuning
• Nextcloud performance tuning
• Q&A
Agenda:
3
3
Copyright 2021 Severalnines AB 4
4
Poll #1
PRESENTER:
Björn Schiessle , Co-founder and PreSales Lead at Nextcloud
bjoern.schiessle@nextcloud.com | www.nextcloud.com | @nextclouders
Nextcloud Architecture
June 15th, 2021
Copyright 2021 Severalnines AB
Nextcloud Hub
Files Talk Groupware Office
6
Copyright 2021 Severalnines AB
Copyright 2021 Severalnines AB
LAMP Stack
7
Copyright 2021 Severalnines AB
Nextcloud Hub Architecture Overview
8
Copyright 2021 Severalnines AB
General Architecture (Files & Groupware)
9
Copyright 2021 Severalnines AB
From small to large Enterprise setups
Single Server Setup
(<= 150 users)
Cluster
(5.000 - 100.000 users)
Global Scale
(Millions of users)
10
Copyright 2021 Severalnines AB
Large Nextcloud Clusters
11
Copyright 2021 Severalnines AB
1
1
2
Poll #2
Ashraf Sharif, Senior Support Engineer, Severalnines
ashraf@severalnines.com | www.severalnines.com
Tips to Drive MariaDB Cluster
Performance for Nextcloud
June 15th, 2021
PRESENTER:
Copyright 2021 Severalnines AB
• Nextcloud Database Characteristics
• Architecture Design
• Performance Tuning & Best Practice
Agenda:
14
Copyright 2021 Severalnines AB
Copyright 2021 Severalnines AB
Nextcloud
Database
Characteristics
Copyright 2021 Severalnines AB
PHP Driver
● PHP PDO module:
○ Database Access Abstraction Layer
○ Offers unified interface to access many different
databases
○ Benefits:
■ Security (usable prepared statements)
■ Usability (many helper functions to automate
routine operations)
■ Reusability (unified API to access multitude of
databases, from SQLite to Oracle)
● Supported databases:
○ MySQL (MariaDB)
○ PostgreSQL
○ SQLite (good for testing only)
○ Oracle 11g (Nexcloud Enterprise only)
● Database stores metadata and administration data. Physical files
are stored inside {path}/nextcloud/data/{user}
16
Copyright 2021 Severalnines AB
/* Calculate read-write ratio */
SELECT @total_com := SUM(IF(variable_name IN
('Com_select', 'Com_delete', 'Com_insert', 'Com_update',
'Com_replace'), variable_value, 0)) AS `Total`,
@total_reads := SUM(IF(variable_name = 'Com_select',
variable_value, 0)) AS `Total reads`,
@total_writes := SUM(IF(variable_name IN ('Com_delete',
'Com_insert', 'Com_update', 'Com_replace'),
variable_value, 0)) AS `Total writes`,
ROUND((@total_reads / @total_com * 100),2) AS `Reads %`,
ROUND((@total_writes / @total_com * 100),2) AS `Writes %`
FROM information_schema.GLOBAL_STATUSG
****************** 1. row **********************
Total: 67293
Total reads: 61300
Total writes: 5993
Reads %: 91.09
Writes %: 8.91
Database Workload
● R/W ratio estimation:
○ Read = read_operations / total_operations * 100
○ Write = write_operations / total_operations * 100
● Read intensive:
○ Focus on read scalability and availability
○ More replicas
○ Cache resource-intensive queries
○ Indexing, query optimization, parallelism
● Write intensive:
○ Focus on write scalability and availability
○ More shards
○ Conflict resolutions
● Generally, Nextcloud DB workload is read-intensive
○ Around 85-90% reads
17
Copyright 2021 Severalnines AB
Task Queries DB Connections
Notifications
(every ~30 secs)
● 18 SELECTs 1
Open a file
● 18 SELECTs
● 1 INSERTs
● 1 UPDATEs
1
Upload a file
● 170 SELECTs
● 20 INSERTs
● 15 UPDATEs
5
Upload 5 files
● 715 SELECTs
● 100 INSERTs
● 85 UPDATEs
18
Delete a file
● 138 SELECTs
● 9 INSERTs
● 29 UPDATEs
● 5 DELETEs
4
Task Queries DB Connections
Delete 5 files
● 358 SELECTs
● 20 INSERTs
● 82 UPDATEs
● 25 DELETEs
7
Move 1 file
● 117 SELECTs
● 5 INSERTs
● 17 UPDATEs
● 1 DELETE
4
Move 5 files
● 475 SELECTs
● 25 INSERTs
● 86 UPDATEs
● 5 DELETEs
10
Copy a directory
containing 1 file
● 189 SELECTs
● 15 INSERTs
● 17 UPDATEs
6
Copy a directory
containing 5 files
● 309 SELECTs
● 39 INSERTs
● 45 UPDATEs
6
**1 Nextcloud user, connecting via web browser. Nextcloud Server
running with standalone MariaDB, without Redis & load balancer.
Nextcloud Database Access Patterns
18
Copyright 2021 Severalnines AB
Copyright 2021 Severalnines AB
Architecture Design
Copyright 2021 Severalnines AB
WSREP API
WSREP API
WSREP API
Galera
What is MariaDB Cluster?
● MariaDB Server patched with:
○ MySQL-writeset replication API (wsrep)
○ Galera wsrep provider library for group
communication and writeset replication
● Linux only, XtraDB & InnoDB storage engine only
● Part of MariaDB since MariaDB 10.1
● 3 nodes for HA ("1-node cluster" is also possible)
● Features:
○ Active-active multi-master
○ Automatic membership control
○ Automatic node joining
○ Parallel slave applying
○ Native MySQL look & feel
● Benefits:
○ Almost no slave lag
○ No lost transactions
○ Read scalability
○ Small client latency
20
Copyright 2021 Severalnines AB
MariaDB version Galera version EOL
10.1 3.x 17th Oct 2020
10.2 3.x 23rd May 2022
10.3 3.x 25th May 2023
10.4 4.x 18th June 2024
10.5 4.x 24th June 2025
Supported Versions
21
Copyright 2021 Severalnines AB
How MariaDB Cluster works?
1. During the commit stage on the originator node:
a. Pre-commit the transaction on the node
b. Encapsulate into writeset (key, seqno, binlog
events)
c. Broadcast to all nodes
2. After receiving the writeset, on all receiver nodes:
a. Galera certifies the replicated writeset
b. If certification succeeds, queue the replicated
writeset to be applied
c. If certification fails, discard the writeset
3. Back on the originator node:
a. If 2b, return OK to client
b. If 2c, return ERROR and rollback the transaction
on the originator node
22
Copyright 2021 Severalnines AB
Task Queries DB Connections
Notifications
(every ~30 secs)
● 18 SELECTs 1
Open a file ● 18 SELECTs
● 1 INSERTs
● 1 UPDATEs
1
(1 writeset)
Upload a file ● 170 SELECTs
● 20 INSERTs
● 15 UPDATEs
5
(33 writesets)
Upload 5 files ● 715 SELECTs
● 100 INSERTs
● 85 UPDATEs
18
(161 writesets)
Delete a file ● 138 SELECTs
● 9 INSERTs
● 29 UPDATEs
● 5 DELETEs
4
(18 writesets)
Task Queries DB Connections
Delete 5 files ● 358 SELECTs
● 20 INSERTs
● 82 UPDATEs
● 25 DELETEs
7 (108 writesets)
Move 1 file ● 117 SELECTs
● 5 INSERTs
● 17 UPDATEs
● 1 DELETE
4 (17 writesets)
Move 5 files ● 475 SELECTs
● 25 INSERTs
● 86 UPDATEs
● 5 DELETEs
10 (60 writesets)
Copy a directory
containing 1 file
● 189 SELECTs
● 15 INSERTs
● 17 UPDATEs
6 (10 writesets)
Copy a directory
containing 5 files
● 309 SELECTs
● 39 INSERTs
● 45 UPDATEs
6 (30 writesets)
**1 Nextcloud user, connecting via web browser. Nextcloud Server
running with standalone MariaDB, without Redis & load balancer.
Nextcloud Writesets
23
Copyright 2021 Severalnines AB
Network latency
(RTT to the farthest node)
Flow control
(throttle the replication if
necessary)
Parallel slave threads
(number of threads to use in
applying slave write-sets)
Hardware specs
(CPU clock, cores, disk
subsystem, RAM, swap,
NIC, etc)
MariaDB + InnoDB
configuration
(I/O, threads, buffers,
caches, etc)
MariaDB Cluster Performance Factors
24
Copyright 2021 Severalnines AB
Design Concept
● Galera Cluster write and replication performance are depending on:
○ Network latency: Lower round trip time (RTT) to the farthest cluster node from originator node is better.
○ Flow control: Galera is as fast as the slowest node in the cluster. Galera will slow down its replication to allow the
slowest node to keep up in attempt to minimize the slave lag.
● Standard MySQL & InnoDB optimizations can be applied for buffers, caches, threads, queries and indexing.
● To take full advantage of a Galera cluster, use a database load balancer (reverse proxy), e.g:
○ ProxySQL
○ MariaDB MaxScale
○ HAProxy
● The importance of database load balancer:
○ Distribute database load to multiple servers
○ Split writes from reads to avoid Galera deadlocks (requires ProxySQL or MaxScale)
○ Automatic redirect connections to the next available node
○ Connection queueing and overload protection
○ Single endpoint for applications
25
Copyright 2021 Severalnines AB
Database Load Balancer
● Centralized:
○ Independent tier
○ Simple and easy to manage
○ Additional hosts for LBs
○ Combine with Virtual IP to eliminate SPOF
● Distributed:
○ Co-locate with each application server
○ Faster from application standpoint (caching, query
rerouting, query firewall)
○ Harder to manage
○ Might affect the health check performance with too
many LB instances
26
Nextcloud
App
Nextcloud
App
APP
LB
LB
APP VIP
LB
LB
LB
Nextcloud
App
Centralized Reverse
Proxies
Distributed Reverse Proxies
Nextcloud
App
Copyright 2021 Severalnines AB
ProxySQL
(Active)
ProxySQL
(Passive)
Virtual IP
Address
RO
RO
RO
RW
RO
RW
Primary writer
Backup writer
Backup writer
Read-Write Splitting
● For Nextcloud workload, read-write splitting is mandatory,
due to:
○ PHP PDO does not support multiple DB hosts per
PDO instance.
○ Some of the Nextcloud tables are missing primary
keys (which is critical for certification and conflict
resolution in Galera replication). Thus, write to a
single node in Galera to eliminate the risk of write-
conflicts.
● Use database load balancer that supports read-write
splitting natively:
○ ProxySQL (via query rules)
○ MariaDB MaxScale (via readwritesplit router)
○ HAProxy (via source IP hash, a.k.a session
stickiness)
27
Copyright 2021 Severalnines AB
● There are two types of I/O operations on MySQL files:
○ Sequential I/O-oriented files:
■ InnoDB system tablespace (ibdata)
■ MySQL log files:
● Binary/Relay logs
● REDO logs (ib_logfile*)
● General logs
● Slow query logs
● Error log
○ Random I/O-oriented files:
■ InnoDB file-per-table data file (*.ibd)
● Storage layer is critical in InnoDB:
○ Use at least SSD for MySQL data directory (or at least
the random I/O-oriented files).
○ RAID 10 is generally good for all workloads.
○ Use filesystem EXT4 or XFS on Linux.
● Mount your file systems with the -o noatime option to skip updates to the last access time
in inodes on the file system, which avoids some disk seeks.
Disk I/O Subsystem
28
Copyright 2021 Severalnines AB
Target Nextcloud active users: 1,000 - 10,000 users
Recommended Architecture I
29
APP
ProxySQL
(Active)
ProxySQL
(Passive)
APP
Virtual IP
Address
Nextcloud App
RO
RO
RO
RW
RO
RW
Copyright 2021 Severalnines AB
Target Nextcloud active users: 10,000 - 100,000 users.
Beyond this, use Nextcloud Federation feature.
Recommended Architecture II
30
APP
ProxySQL
(Active)
ProxySQL
(Passive)
APP
Virtual IP
Address
Nextcloud App
RO
RO
RO
RW
RO
RW
Redis
Redis
Redis Asynchronous
slave
Cache
Copyright 2021 Severalnines AB
Copyright 2021 Severalnines AB
Performance Tuning
Copyright 2021 Severalnines AB
Performance Tuning
● Tuning motivation:
○ Improve database read & write performance.
○ As minimal tradeoffs as possible.
● Requirements and specs:
○ Database vendor and server version: MariaDB 10.5.4
○ Database cluster type: Galera cluster
○ Nextcloud version: Stable 19.0.1
○ Target Nextcloud users: 10,000 users
○ Target Nextcloud database size: ~10 GB
○ Database load balancer: ProxySQL 2.0.13
● Some of the suggested MariaDB configuration options are applicable to MySQL 5.6 & MySQL 5.7.
32
Copyright 2021 Severalnines AB
MariaDB Cluster Performance Factors
Network latency
(RTT to the farthest
node)
Flow control
(throttle the
replication if
necessary)
Parallel slave threads
(number of threads to
use in applying slave
write-sets)
Hardware specs
(CPU clock, cores,
disk subsystem, RAM,
swap, NIC, etc)
MariaDB + InnoDB
configuration
(I/O, threads, buffers,
caches, etc)
Copyright 2021 Severalnines AB
Parameter Recommended Value Justification
max_connections 500 ProxySQL can handle thousands of client connections with
connection pooling and multiplexing. Don't set this too high.
performance_schema OFF Default is enabled. 3-5% performance overhead if enabled.
log_bin OFF (unset) Default is disabled. 10-15% performance overhead if enabled.
skip_name_resolve ON If you need to use hostname or FQDN, make sure /etc/hosts is
mapped with all hosts that is going to connect to the cluster on all
Galera nodes. Do not rely on DNS resolver.
max_allowed_packet 64M The default is 16M. You can go up to 1G to improve packet
transmission and faster mysqldump. Increase in 16,32,64 style.
sync_binlog OFF (unset) Default is disabled (usually this would be enabled together with
log_bin). 20-30% performance overhead if enabled.
*Based on MariaDB 10.5.4 default values.
General MariaDB Tuning
34
Copyright 2021 Severalnines AB
Parameter Recommended Value Justification
innodb_buffer_pool_size 50 - 70% of RAM, specify with K, M, G.
Example: 20G
Try to fit total data + index into memory to avoid hitting disk.
innodb_buffer_pool_instances Starts with 8, maximum is 64. If buffer pool > 8G, starts with 8. Go with 16, 32, 64 incremental if
necessary. Specify a combination of innodb_buffer_pool_instances
and innodb_buffer_pool_size so that each buffer pool instance is
at least 1 GB.
tx_isolation 'READ-COMMITTED' Transaction isolation level recommended by Nextcloud.
innodb_io_capacity ● SATA SSD starts with 1000
● NVMe starts with 10000
The default value 200. Should be set to around the number of IOPS
that system can handle. Ideally, opt for a lower setting, as at higher
value data is removed from the buffers too quickly, reducing the
effectiveness of caching.
innodb_io_capacity_max ● SATA SSD starts with 4000
● NVMe starts with 20000
The default value 2000. Hard limit of innodb_io_capacity.
innodb_flush_method 'O_DIRECT' Default is fsync. Use this if the MariaDB data directory is located on
a direct physical disk.
*Based on MariaDB 10.5.4 default values.
InnoDB Tuning (1 of 2)
Copyright 2021 Severalnines AB
Parameter Recommended Value Justification
innodb_read_io_threads Number of CPU cores Default is 4. Max is 64. The total number of innodb_*_io_threads
should not surpass the total number of CPU cores available to
MariaDB.
innodb_write_io_threads Number of CPU cores Default is 4. Max is 64. The total number of innodb_*_io_threads
should not surpass the total number of CPU cores available to
MariaDB.
innodb_log_file_size 512M Default is 96M. The larger the value, the less checkpoint flush
activity is required in the buffer pool, saving disk I/O with a
tradeoff of slower recovery. However, it doesn't really matter in
Galera since we have other operational nodes to cover the service
availability while the node is recovering.
innodb_flush_log_at_trx_commit 0 Default is 1 for full durability. This can be relaxed in Galera, since
we always have other nodes to cover write durability. Set to 0 so
InnoDB log buffer is written to file once per second. Up to 100% to
200% improvement.
*Based on MariaDB 10.5.4 default values.
InnoDB Tuning (2 of 2)
Copyright 2021 Severalnines AB
InnoDB Buffer Pool Best Practice
• Reading a row from disk is about 100,000 times slower than
reading the same row from RAM.
• Therefore, InnoDB uses its own buffer,
innodb_buffer_pool_size as the "working area".
• The first read of data copies the data to RAM, and then
subsequent reads take advantage of the faster performance
of RAM.
• Basic rule-of-thumb:
◦ If your database size can fit into the buffer pool size,
MariaDB will very likely not hitting the disk.
◦ Try to reach 1000/1000 in the buffer pool hit rate.
37
mysql> SHOW ENGINE INNODB STATUSG
...
----------------------
BUFFER POOL AND MEMORY
----------------------
...
Buffer pool hit rate 929 / 1000 ...
...
The hit rate of 929 / 1000 indicates that out of 1000
row reads, it was able to read the row in RAM 929
times. The remaining 71 times, it had to read the row
of data from disk.
This is not a bad ratio, but if your frequently-accessed
data fits fully in RAM, you'll see this ratio increase to
999 / 1000 or even round up to 1000 / 1000.
Copyright 2021 Severalnines AB
Parameter Recommended Value Justification
wsrep_slave_threads Number of CPU cores x 2 The minimum value for the slave threads should be 2 x number of
CPU cores, and must not exceed the wsrep_cert_deps_distance
value.
wsrep_provider_options "gcache.size=2G" Default is 128M. The bigger gcache size, the higher chance of a
joiner can join with incremental state transfer (IST). IST is faster
and lesser impact than full syncing (SST).
*Based on MariaDB 10.5.4 default values.
Galera Tuning
38
Copyright 2021 Severalnines AB
● If you opt for multi-writer Galera setup, make sure every
table has an explicit primary key defined.
○ Some tables in Nextcloud do not have a PK defined. Simply
add a primary key with auto-increment column.
● DDL operations (ALTER, CREATE, TRUNCATE, DROP) might cause
the cluster to stall (wsrep_OSU_method is 'TOI') until the
operation completes.
○ Perform NextCloud upgrade (commonly contains DDL
operations) during a maintenance window, or low-peak
hours or use online schema change tools like pt-online-
schema-change.
● Due to flow-control, if one of the nodes slows down, very
likely the replication performance will slow down as well.
○ Run heavy operations like backup, reporting or analytics
during low-peak hours.
○ Attach an asynchronous replication slave, replicate from
one of the Galera nodes.
/* Get tables without primary keys */
SELECT DISTINCT CONCAT(t.table_schema,'.',t.table_name) AS
tbl, t.engine, IF(ISNULL(c.constraint_name),'NOPK','') AS
nopk, IF(s.index_type = 'FULLTEXT','FULLTEXT','') AS ftidx,
IF(s.index_type = 'SPATIAL','SPATIAL','') AS gisidx
FROM information_schema.tables AS t LEFT JOIN
information_schema.key_column_usage AS c ON (t.table_schema
= c.constraint_schema AND t.table_name = c.table_name AND
c.constraint_name = 'PRIMARY') LEFT JOIN
information_schema.statistics AS s ON (t.table_schema =
s.table_schema AND t.table_name = s.table_name AND
s.index_type IN ('FULLTEXT','SPATIAL'))
WHERE t.table_schema NOT IN
('information_schema','performance_schema','mysql') AND
t.table_type = 'BASE TABLE' AND (t.engine <> 'InnoDB' OR
c.constraint_name IS NULL OR s.index_type IN
('FULLTEXT','SPATIAL'))
ORDER BY t.table_schema,t.table_name;
/* Add an auto-increment primary key */
ALTER TABLE nextcloud.oc_collres_accesscache ADD COLUMN `id` INT
PRIMARY KEY AUTO_INCREMENT;
Galera Best Practice
39
Copyright 2021 Severalnines AB
● Enable Redis to offload the database cluster from handling the
transactional file locking job.
● A performance boost on installations going from tens of thousands to
hundreds of thousands of users
○ E.g, when editing a single text file, the database writes decreases by
~40-50% (26 writes vs 14 writes).
○ Reduce write contention on table oc_file_locks.
● Package php-redis must be installed
○ If Redis is running on the same system as Nextcloud, configure it to
listen on an Unix socket.
○ Redis Cluster is also supported, while authentication requires php-redis
4.2.1+.
○ With cluster-mode enabled, there is no need to use a load balancer
since php-redis is already cluster-aware (php-redis 3.0.0+).
● You can also use Redis as PHP sessions handler (requires changes to
php.ini).
// Nextcloud config.php
'filelocking.enabled' => true,
'memcache.locking' => 'OCMemcacheRedis',
'memcache.distributed' => 'OCMemcacheRedis',
'redis' => [
'host' => '/var/run/redis/redis.sock',
'port' => 0,
],
// Nextcloud config.php
'redis.cluster' => [
'seeds' => [
'192.168.10.101:6379',
'192.168.10.103:6379',
'192.168.10.102:6379',
],
'timeout' => 0.0,
'read_timeout' => 0.0,
'failover_mode' => RedisCluster::FAILOVER_ERROR,
'password' => '',
],
// php.ini
session.save_handler = 'redis';// or 'rediscluster'
session.save_path = 'tcp://127.0.0.1:6379'
Caching
40
Copyright 2021 Severalnines AB
41

More Related Content

What's hot

MySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptxMySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptxNeoClova
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyJean-François Gagné
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability Mydbops
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Mydbops
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7Zhaoyang Wang
 
MariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationMariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationFrancisco Gonçalves
 
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)Jean-François Gagné
 
MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바NeoClova
 
Galera Cluster - Node Recovery - Webinar slides
Galera Cluster - Node Recovery - Webinar slidesGalera Cluster - Node Recovery - Webinar slides
Galera Cluster - Node Recovery - Webinar slidesSeveralnines
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기NHN FORWARD
 
How to set up orchestrator to manage thousands of MySQL servers
How to set up orchestrator to manage thousands of MySQL serversHow to set up orchestrator to manage thousands of MySQL servers
How to set up orchestrator to manage thousands of MySQL serversSimon J Mudd
 
Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기NeoClova
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsMydbops
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera ClusterAbdul Manaf
 
Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0Olivier DASINI
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)Altinity Ltd
 
MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼NeoClova
 
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docxKeepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docxNeoClova
 

What's hot (20)

MySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptxMySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptx
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash Safety
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7
 
MariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationMariaDB Galera Cluster presentation
MariaDB Galera Cluster presentation
 
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
 
Query logging with proxysql
Query logging with proxysqlQuery logging with proxysql
Query logging with proxysql
 
MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바
 
Galera Cluster - Node Recovery - Webinar slides
Galera Cluster - Node Recovery - Webinar slidesGalera Cluster - Node Recovery - Webinar slides
Galera Cluster - Node Recovery - Webinar slides
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기
 
How to set up orchestrator to manage thousands of MySQL servers
How to set up orchestrator to manage thousands of MySQL serversHow to set up orchestrator to manage thousands of MySQL servers
How to set up orchestrator to manage thousands of MySQL servers
 
Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient Backups
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera Cluster
 
Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
 
ProxySQL at Scale on AWS.pdf
ProxySQL at Scale on AWS.pdfProxySQL at Scale on AWS.pdf
ProxySQL at Scale on AWS.pdf
 
MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼
 
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docxKeepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
 

Similar to Tips to drive maria db cluster performance for nextcloud

Webinar slides: Severalnines & MariaDB present: Automation & Management of Ma...
Webinar slides: Severalnines & MariaDB present: Automation & Management of Ma...Webinar slides: Severalnines & MariaDB present: Automation & Management of Ma...
Webinar slides: Severalnines & MariaDB present: Automation & Management of Ma...Severalnines
 
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server MariaDB plc
 
High performance and high availability proxies for MySQL
High performance and high availability proxies for MySQLHigh performance and high availability proxies for MySQL
High performance and high availability proxies for MySQLMydbops
 
What's New in MySQL 8.0 @ HKOSC 2017
What's New in MySQL 8.0 @ HKOSC 2017What's New in MySQL 8.0 @ HKOSC 2017
What's New in MySQL 8.0 @ HKOSC 2017Ivan Ma
 
Python And The MySQL X DevAPI - PyCaribbean 2019
Python And The MySQL X DevAPI - PyCaribbean 2019Python And The MySQL X DevAPI - PyCaribbean 2019
Python And The MySQL X DevAPI - PyCaribbean 2019Dave Stokes
 
Die Neuheiten in MariaDB Enterprise Server
Die Neuheiten in MariaDB Enterprise ServerDie Neuheiten in MariaDB Enterprise Server
Die Neuheiten in MariaDB Enterprise ServerMariaDB plc
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Severalnines
 
MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017Severalnines
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixC4Media
 
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...Neo4j
 
MySQL 5.6 Replication Webinar
MySQL 5.6 Replication WebinarMySQL 5.6 Replication Webinar
MySQL 5.6 Replication WebinarMark Swarbrick
 
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...Restlet
 
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise SearchRestlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise SearchDataStax Academy
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
MySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics ImprovementsMySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics ImprovementsMorgan Tocker
 
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.Geir Høydalsvik
 
Benchmarking for postgresql workloads in kubernetes
Benchmarking for postgresql workloads in kubernetesBenchmarking for postgresql workloads in kubernetes
Benchmarking for postgresql workloads in kubernetesDoKC
 
DataEng Mad - 03.03.2020 - Tibero 30-min Presentation.pdf
DataEng Mad - 03.03.2020 - Tibero 30-min Presentation.pdfDataEng Mad - 03.03.2020 - Tibero 30-min Presentation.pdf
DataEng Mad - 03.03.2020 - Tibero 30-min Presentation.pdfMiguel Angel Fajardo
 
How SQL Server 2016 SP1 Changes the Game
How SQL Server 2016 SP1 Changes the GameHow SQL Server 2016 SP1 Changes the Game
How SQL Server 2016 SP1 Changes the GamePARIKSHIT SAVJANI
 
OpenEBS hangout #4
OpenEBS hangout #4OpenEBS hangout #4
OpenEBS hangout #4OpenEBS
 

Similar to Tips to drive maria db cluster performance for nextcloud (20)

Webinar slides: Severalnines & MariaDB present: Automation & Management of Ma...
Webinar slides: Severalnines & MariaDB present: Automation & Management of Ma...Webinar slides: Severalnines & MariaDB present: Automation & Management of Ma...
Webinar slides: Severalnines & MariaDB present: Automation & Management of Ma...
 
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
 
High performance and high availability proxies for MySQL
High performance and high availability proxies for MySQLHigh performance and high availability proxies for MySQL
High performance and high availability proxies for MySQL
 
What's New in MySQL 8.0 @ HKOSC 2017
What's New in MySQL 8.0 @ HKOSC 2017What's New in MySQL 8.0 @ HKOSC 2017
What's New in MySQL 8.0 @ HKOSC 2017
 
Python And The MySQL X DevAPI - PyCaribbean 2019
Python And The MySQL X DevAPI - PyCaribbean 2019Python And The MySQL X DevAPI - PyCaribbean 2019
Python And The MySQL X DevAPI - PyCaribbean 2019
 
Die Neuheiten in MariaDB Enterprise Server
Die Neuheiten in MariaDB Enterprise ServerDie Neuheiten in MariaDB Enterprise Server
Die Neuheiten in MariaDB Enterprise Server
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
 
MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFix
 
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
 
MySQL 5.6 Replication Webinar
MySQL 5.6 Replication WebinarMySQL 5.6 Replication Webinar
MySQL 5.6 Replication Webinar
 
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
 
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise SearchRestlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
MySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics ImprovementsMySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics Improvements
 
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
 
Benchmarking for postgresql workloads in kubernetes
Benchmarking for postgresql workloads in kubernetesBenchmarking for postgresql workloads in kubernetes
Benchmarking for postgresql workloads in kubernetes
 
DataEng Mad - 03.03.2020 - Tibero 30-min Presentation.pdf
DataEng Mad - 03.03.2020 - Tibero 30-min Presentation.pdfDataEng Mad - 03.03.2020 - Tibero 30-min Presentation.pdf
DataEng Mad - 03.03.2020 - Tibero 30-min Presentation.pdf
 
How SQL Server 2016 SP1 Changes the Game
How SQL Server 2016 SP1 Changes the GameHow SQL Server 2016 SP1 Changes the Game
How SQL Server 2016 SP1 Changes the Game
 
OpenEBS hangout #4
OpenEBS hangout #4OpenEBS hangout #4
OpenEBS hangout #4
 

More from Severalnines

Cloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSCloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSSeveralnines
 
Working with the Moodle Database: The Basics
Working with the Moodle Database: The BasicsWorking with the Moodle Database: The Basics
Working with the Moodle Database: The BasicsSeveralnines
 
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSeveralnines
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...Severalnines
 
Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBSeveralnines
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlSeveralnines
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Severalnines
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Severalnines
 
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBSeveralnines
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseSeveralnines
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBSeveralnines
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerAdvanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerSeveralnines
 
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifePolyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifeSeveralnines
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLSeveralnines
 
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningWebinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningSeveralnines
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBSeveralnines
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Severalnines
 
Webinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High AvailabilityWebinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High AvailabilitySeveralnines
 
Webinar slides: How to Get Started with Open Source Database Management
Webinar slides: How to Get Started with Open Source Database ManagementWebinar slides: How to Get Started with Open Source Database Management
Webinar slides: How to Get Started with Open Source Database ManagementSeveralnines
 
Webinar slides: How to Achieve PCI Compliance for MySQL & MariaDB with Cluste...
Webinar slides: How to Achieve PCI Compliance for MySQL & MariaDB with Cluste...Webinar slides: How to Achieve PCI Compliance for MySQL & MariaDB with Cluste...
Webinar slides: How to Achieve PCI Compliance for MySQL & MariaDB with Cluste...Severalnines
 

More from Severalnines (20)

Cloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSCloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaS
 
Working with the Moodle Database: The Basics
Working with the Moodle Database: The BasicsWorking with the Moodle Database: The Basics
Working with the Moodle Database: The Basics
 
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
 
Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDB
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
 
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDB
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash Course
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDB
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerAdvanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona Server
 
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifePolyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
 
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningWebinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?
 
Webinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High AvailabilityWebinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High Availability
 
Webinar slides: How to Get Started with Open Source Database Management
Webinar slides: How to Get Started with Open Source Database ManagementWebinar slides: How to Get Started with Open Source Database Management
Webinar slides: How to Get Started with Open Source Database Management
 
Webinar slides: How to Achieve PCI Compliance for MySQL & MariaDB with Cluste...
Webinar slides: How to Achieve PCI Compliance for MySQL & MariaDB with Cluste...Webinar slides: How to Achieve PCI Compliance for MySQL & MariaDB with Cluste...
Webinar slides: How to Achieve PCI Compliance for MySQL & MariaDB with Cluste...
 

Recently uploaded

Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...Prakhyath Rai
 
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdfDR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdfDrGurudutt
 
Theory for How to calculation capacitor bank
Theory for How to calculation capacitor bankTheory for How to calculation capacitor bank
Theory for How to calculation capacitor banktawat puangthong
 
Circuit Breaker arc phenomenon.pdf engineering
Circuit Breaker arc phenomenon.pdf engineeringCircuit Breaker arc phenomenon.pdf engineering
Circuit Breaker arc phenomenon.pdf engineeringKanchhaTamang
 
Quiz application system project report..pdf
Quiz application system project report..pdfQuiz application system project report..pdf
Quiz application system project report..pdfKamal Acharya
 
E-Commerce Shopping using MERN Stack where different modules are present
E-Commerce Shopping using MERN Stack where different modules are presentE-Commerce Shopping using MERN Stack where different modules are present
E-Commerce Shopping using MERN Stack where different modules are presentjatinraor66
 
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5T.D. Shashikala
 
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfMadan Karki
 
Electrical shop management system project report.pdf
Electrical shop management system project report.pdfElectrical shop management system project report.pdf
Electrical shop management system project report.pdfKamal Acharya
 
Lab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docxLab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docxRashidFaridChishti
 
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message QueuesLinux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message QueuesRashidFaridChishti
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1T.D. Shashikala
 
Lesson no16 application of Induction Generator in Wind.ppsx
Lesson no16 application of Induction Generator in Wind.ppsxLesson no16 application of Induction Generator in Wind.ppsx
Lesson no16 application of Induction Generator in Wind.ppsxmichaelprrior
 
ChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdfChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdfqasastareekh
 
ANSI(ST)-III_Manufacturing-I_05052020.pdf
ANSI(ST)-III_Manufacturing-I_05052020.pdfANSI(ST)-III_Manufacturing-I_05052020.pdf
ANSI(ST)-III_Manufacturing-I_05052020.pdfBertinKamsipa1
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsMathias Magdowski
 
How to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdfHow to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdftawat puangthong
 
Online book store management system project.pdf
Online book store management system project.pdfOnline book store management system project.pdf
Online book store management system project.pdfKamal Acharya
 
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWINGBRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWINGKOUSTAV SARKAR
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineJulioCesarSalazarHer1
 

Recently uploaded (20)

Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...
 
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdfDR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
 
Theory for How to calculation capacitor bank
Theory for How to calculation capacitor bankTheory for How to calculation capacitor bank
Theory for How to calculation capacitor bank
 
Circuit Breaker arc phenomenon.pdf engineering
Circuit Breaker arc phenomenon.pdf engineeringCircuit Breaker arc phenomenon.pdf engineering
Circuit Breaker arc phenomenon.pdf engineering
 
Quiz application system project report..pdf
Quiz application system project report..pdfQuiz application system project report..pdf
Quiz application system project report..pdf
 
E-Commerce Shopping using MERN Stack where different modules are present
E-Commerce Shopping using MERN Stack where different modules are presentE-Commerce Shopping using MERN Stack where different modules are present
E-Commerce Shopping using MERN Stack where different modules are present
 
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
 
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
 
Electrical shop management system project report.pdf
Electrical shop management system project report.pdfElectrical shop management system project report.pdf
Electrical shop management system project report.pdf
 
Lab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docxLab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docx
 
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message QueuesLinux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
Lesson no16 application of Induction Generator in Wind.ppsx
Lesson no16 application of Induction Generator in Wind.ppsxLesson no16 application of Induction Generator in Wind.ppsx
Lesson no16 application of Induction Generator in Wind.ppsx
 
ChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdfChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdf
 
ANSI(ST)-III_Manufacturing-I_05052020.pdf
ANSI(ST)-III_Manufacturing-I_05052020.pdfANSI(ST)-III_Manufacturing-I_05052020.pdf
ANSI(ST)-III_Manufacturing-I_05052020.pdf
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
 
How to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdfHow to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdf
 
Online book store management system project.pdf
Online book store management system project.pdfOnline book store management system project.pdf
Online book store management system project.pdf
 
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWINGBRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission line
 

Tips to drive maria db cluster performance for nextcloud

  • 1.
  • 2. Copyright 2021 Severalnines AB 2 Hello! I'm Vinay from the Severalnines Team and I'm your host for today's webinar! Feel free to ask any questions via the Q&A chat. You can also contact me directly via the chat box or via email: info@severalnines.com during or after the webinar. Björn Schiessle Co-founder and PreSales Lead at Nextcloud Ashraf Sharif Senior Support Engineer at Severalnines Our Presenters: Welcome note
  • 3. Copyright 2021 Severalnines AB • Overview of Nextcloud architecture • Database architecture design • Database proxy • MariaDB and InnoDB performance tuning • Nextcloud performance tuning • Q&A Agenda: 3 3
  • 5. PRESENTER: Björn Schiessle , Co-founder and PreSales Lead at Nextcloud bjoern.schiessle@nextcloud.com | www.nextcloud.com | @nextclouders Nextcloud Architecture June 15th, 2021
  • 6. Copyright 2021 Severalnines AB Nextcloud Hub Files Talk Groupware Office 6
  • 7. Copyright 2021 Severalnines AB Copyright 2021 Severalnines AB LAMP Stack 7
  • 8. Copyright 2021 Severalnines AB Nextcloud Hub Architecture Overview 8
  • 9. Copyright 2021 Severalnines AB General Architecture (Files & Groupware) 9
  • 10. Copyright 2021 Severalnines AB From small to large Enterprise setups Single Server Setup (<= 150 users) Cluster (5.000 - 100.000 users) Global Scale (Millions of users) 10
  • 11. Copyright 2021 Severalnines AB Large Nextcloud Clusters 11
  • 12. Copyright 2021 Severalnines AB 1 1 2 Poll #2
  • 13. Ashraf Sharif, Senior Support Engineer, Severalnines ashraf@severalnines.com | www.severalnines.com Tips to Drive MariaDB Cluster Performance for Nextcloud June 15th, 2021 PRESENTER:
  • 14. Copyright 2021 Severalnines AB • Nextcloud Database Characteristics • Architecture Design • Performance Tuning & Best Practice Agenda: 14
  • 15. Copyright 2021 Severalnines AB Copyright 2021 Severalnines AB Nextcloud Database Characteristics
  • 16. Copyright 2021 Severalnines AB PHP Driver ● PHP PDO module: ○ Database Access Abstraction Layer ○ Offers unified interface to access many different databases ○ Benefits: ■ Security (usable prepared statements) ■ Usability (many helper functions to automate routine operations) ■ Reusability (unified API to access multitude of databases, from SQLite to Oracle) ● Supported databases: ○ MySQL (MariaDB) ○ PostgreSQL ○ SQLite (good for testing only) ○ Oracle 11g (Nexcloud Enterprise only) ● Database stores metadata and administration data. Physical files are stored inside {path}/nextcloud/data/{user} 16
  • 17. Copyright 2021 Severalnines AB /* Calculate read-write ratio */ SELECT @total_com := SUM(IF(variable_name IN ('Com_select', 'Com_delete', 'Com_insert', 'Com_update', 'Com_replace'), variable_value, 0)) AS `Total`, @total_reads := SUM(IF(variable_name = 'Com_select', variable_value, 0)) AS `Total reads`, @total_writes := SUM(IF(variable_name IN ('Com_delete', 'Com_insert', 'Com_update', 'Com_replace'), variable_value, 0)) AS `Total writes`, ROUND((@total_reads / @total_com * 100),2) AS `Reads %`, ROUND((@total_writes / @total_com * 100),2) AS `Writes %` FROM information_schema.GLOBAL_STATUSG ****************** 1. row ********************** Total: 67293 Total reads: 61300 Total writes: 5993 Reads %: 91.09 Writes %: 8.91 Database Workload ● R/W ratio estimation: ○ Read = read_operations / total_operations * 100 ○ Write = write_operations / total_operations * 100 ● Read intensive: ○ Focus on read scalability and availability ○ More replicas ○ Cache resource-intensive queries ○ Indexing, query optimization, parallelism ● Write intensive: ○ Focus on write scalability and availability ○ More shards ○ Conflict resolutions ● Generally, Nextcloud DB workload is read-intensive ○ Around 85-90% reads 17
  • 18. Copyright 2021 Severalnines AB Task Queries DB Connections Notifications (every ~30 secs) ● 18 SELECTs 1 Open a file ● 18 SELECTs ● 1 INSERTs ● 1 UPDATEs 1 Upload a file ● 170 SELECTs ● 20 INSERTs ● 15 UPDATEs 5 Upload 5 files ● 715 SELECTs ● 100 INSERTs ● 85 UPDATEs 18 Delete a file ● 138 SELECTs ● 9 INSERTs ● 29 UPDATEs ● 5 DELETEs 4 Task Queries DB Connections Delete 5 files ● 358 SELECTs ● 20 INSERTs ● 82 UPDATEs ● 25 DELETEs 7 Move 1 file ● 117 SELECTs ● 5 INSERTs ● 17 UPDATEs ● 1 DELETE 4 Move 5 files ● 475 SELECTs ● 25 INSERTs ● 86 UPDATEs ● 5 DELETEs 10 Copy a directory containing 1 file ● 189 SELECTs ● 15 INSERTs ● 17 UPDATEs 6 Copy a directory containing 5 files ● 309 SELECTs ● 39 INSERTs ● 45 UPDATEs 6 **1 Nextcloud user, connecting via web browser. Nextcloud Server running with standalone MariaDB, without Redis & load balancer. Nextcloud Database Access Patterns 18
  • 19. Copyright 2021 Severalnines AB Copyright 2021 Severalnines AB Architecture Design
  • 20. Copyright 2021 Severalnines AB WSREP API WSREP API WSREP API Galera What is MariaDB Cluster? ● MariaDB Server patched with: ○ MySQL-writeset replication API (wsrep) ○ Galera wsrep provider library for group communication and writeset replication ● Linux only, XtraDB & InnoDB storage engine only ● Part of MariaDB since MariaDB 10.1 ● 3 nodes for HA ("1-node cluster" is also possible) ● Features: ○ Active-active multi-master ○ Automatic membership control ○ Automatic node joining ○ Parallel slave applying ○ Native MySQL look & feel ● Benefits: ○ Almost no slave lag ○ No lost transactions ○ Read scalability ○ Small client latency 20
  • 21. Copyright 2021 Severalnines AB MariaDB version Galera version EOL 10.1 3.x 17th Oct 2020 10.2 3.x 23rd May 2022 10.3 3.x 25th May 2023 10.4 4.x 18th June 2024 10.5 4.x 24th June 2025 Supported Versions 21
  • 22. Copyright 2021 Severalnines AB How MariaDB Cluster works? 1. During the commit stage on the originator node: a. Pre-commit the transaction on the node b. Encapsulate into writeset (key, seqno, binlog events) c. Broadcast to all nodes 2. After receiving the writeset, on all receiver nodes: a. Galera certifies the replicated writeset b. If certification succeeds, queue the replicated writeset to be applied c. If certification fails, discard the writeset 3. Back on the originator node: a. If 2b, return OK to client b. If 2c, return ERROR and rollback the transaction on the originator node 22
  • 23. Copyright 2021 Severalnines AB Task Queries DB Connections Notifications (every ~30 secs) ● 18 SELECTs 1 Open a file ● 18 SELECTs ● 1 INSERTs ● 1 UPDATEs 1 (1 writeset) Upload a file ● 170 SELECTs ● 20 INSERTs ● 15 UPDATEs 5 (33 writesets) Upload 5 files ● 715 SELECTs ● 100 INSERTs ● 85 UPDATEs 18 (161 writesets) Delete a file ● 138 SELECTs ● 9 INSERTs ● 29 UPDATEs ● 5 DELETEs 4 (18 writesets) Task Queries DB Connections Delete 5 files ● 358 SELECTs ● 20 INSERTs ● 82 UPDATEs ● 25 DELETEs 7 (108 writesets) Move 1 file ● 117 SELECTs ● 5 INSERTs ● 17 UPDATEs ● 1 DELETE 4 (17 writesets) Move 5 files ● 475 SELECTs ● 25 INSERTs ● 86 UPDATEs ● 5 DELETEs 10 (60 writesets) Copy a directory containing 1 file ● 189 SELECTs ● 15 INSERTs ● 17 UPDATEs 6 (10 writesets) Copy a directory containing 5 files ● 309 SELECTs ● 39 INSERTs ● 45 UPDATEs 6 (30 writesets) **1 Nextcloud user, connecting via web browser. Nextcloud Server running with standalone MariaDB, without Redis & load balancer. Nextcloud Writesets 23
  • 24. Copyright 2021 Severalnines AB Network latency (RTT to the farthest node) Flow control (throttle the replication if necessary) Parallel slave threads (number of threads to use in applying slave write-sets) Hardware specs (CPU clock, cores, disk subsystem, RAM, swap, NIC, etc) MariaDB + InnoDB configuration (I/O, threads, buffers, caches, etc) MariaDB Cluster Performance Factors 24
  • 25. Copyright 2021 Severalnines AB Design Concept ● Galera Cluster write and replication performance are depending on: ○ Network latency: Lower round trip time (RTT) to the farthest cluster node from originator node is better. ○ Flow control: Galera is as fast as the slowest node in the cluster. Galera will slow down its replication to allow the slowest node to keep up in attempt to minimize the slave lag. ● Standard MySQL & InnoDB optimizations can be applied for buffers, caches, threads, queries and indexing. ● To take full advantage of a Galera cluster, use a database load balancer (reverse proxy), e.g: ○ ProxySQL ○ MariaDB MaxScale ○ HAProxy ● The importance of database load balancer: ○ Distribute database load to multiple servers ○ Split writes from reads to avoid Galera deadlocks (requires ProxySQL or MaxScale) ○ Automatic redirect connections to the next available node ○ Connection queueing and overload protection ○ Single endpoint for applications 25
  • 26. Copyright 2021 Severalnines AB Database Load Balancer ● Centralized: ○ Independent tier ○ Simple and easy to manage ○ Additional hosts for LBs ○ Combine with Virtual IP to eliminate SPOF ● Distributed: ○ Co-locate with each application server ○ Faster from application standpoint (caching, query rerouting, query firewall) ○ Harder to manage ○ Might affect the health check performance with too many LB instances 26 Nextcloud App Nextcloud App APP LB LB APP VIP LB LB LB Nextcloud App Centralized Reverse Proxies Distributed Reverse Proxies Nextcloud App
  • 27. Copyright 2021 Severalnines AB ProxySQL (Active) ProxySQL (Passive) Virtual IP Address RO RO RO RW RO RW Primary writer Backup writer Backup writer Read-Write Splitting ● For Nextcloud workload, read-write splitting is mandatory, due to: ○ PHP PDO does not support multiple DB hosts per PDO instance. ○ Some of the Nextcloud tables are missing primary keys (which is critical for certification and conflict resolution in Galera replication). Thus, write to a single node in Galera to eliminate the risk of write- conflicts. ● Use database load balancer that supports read-write splitting natively: ○ ProxySQL (via query rules) ○ MariaDB MaxScale (via readwritesplit router) ○ HAProxy (via source IP hash, a.k.a session stickiness) 27
  • 28. Copyright 2021 Severalnines AB ● There are two types of I/O operations on MySQL files: ○ Sequential I/O-oriented files: ■ InnoDB system tablespace (ibdata) ■ MySQL log files: ● Binary/Relay logs ● REDO logs (ib_logfile*) ● General logs ● Slow query logs ● Error log ○ Random I/O-oriented files: ■ InnoDB file-per-table data file (*.ibd) ● Storage layer is critical in InnoDB: ○ Use at least SSD for MySQL data directory (or at least the random I/O-oriented files). ○ RAID 10 is generally good for all workloads. ○ Use filesystem EXT4 or XFS on Linux. ● Mount your file systems with the -o noatime option to skip updates to the last access time in inodes on the file system, which avoids some disk seeks. Disk I/O Subsystem 28
  • 29. Copyright 2021 Severalnines AB Target Nextcloud active users: 1,000 - 10,000 users Recommended Architecture I 29 APP ProxySQL (Active) ProxySQL (Passive) APP Virtual IP Address Nextcloud App RO RO RO RW RO RW
  • 30. Copyright 2021 Severalnines AB Target Nextcloud active users: 10,000 - 100,000 users. Beyond this, use Nextcloud Federation feature. Recommended Architecture II 30 APP ProxySQL (Active) ProxySQL (Passive) APP Virtual IP Address Nextcloud App RO RO RO RW RO RW Redis Redis Redis Asynchronous slave Cache
  • 31. Copyright 2021 Severalnines AB Copyright 2021 Severalnines AB Performance Tuning
  • 32. Copyright 2021 Severalnines AB Performance Tuning ● Tuning motivation: ○ Improve database read & write performance. ○ As minimal tradeoffs as possible. ● Requirements and specs: ○ Database vendor and server version: MariaDB 10.5.4 ○ Database cluster type: Galera cluster ○ Nextcloud version: Stable 19.0.1 ○ Target Nextcloud users: 10,000 users ○ Target Nextcloud database size: ~10 GB ○ Database load balancer: ProxySQL 2.0.13 ● Some of the suggested MariaDB configuration options are applicable to MySQL 5.6 & MySQL 5.7. 32
  • 33. Copyright 2021 Severalnines AB MariaDB Cluster Performance Factors Network latency (RTT to the farthest node) Flow control (throttle the replication if necessary) Parallel slave threads (number of threads to use in applying slave write-sets) Hardware specs (CPU clock, cores, disk subsystem, RAM, swap, NIC, etc) MariaDB + InnoDB configuration (I/O, threads, buffers, caches, etc)
  • 34. Copyright 2021 Severalnines AB Parameter Recommended Value Justification max_connections 500 ProxySQL can handle thousands of client connections with connection pooling and multiplexing. Don't set this too high. performance_schema OFF Default is enabled. 3-5% performance overhead if enabled. log_bin OFF (unset) Default is disabled. 10-15% performance overhead if enabled. skip_name_resolve ON If you need to use hostname or FQDN, make sure /etc/hosts is mapped with all hosts that is going to connect to the cluster on all Galera nodes. Do not rely on DNS resolver. max_allowed_packet 64M The default is 16M. You can go up to 1G to improve packet transmission and faster mysqldump. Increase in 16,32,64 style. sync_binlog OFF (unset) Default is disabled (usually this would be enabled together with log_bin). 20-30% performance overhead if enabled. *Based on MariaDB 10.5.4 default values. General MariaDB Tuning 34
  • 35. Copyright 2021 Severalnines AB Parameter Recommended Value Justification innodb_buffer_pool_size 50 - 70% of RAM, specify with K, M, G. Example: 20G Try to fit total data + index into memory to avoid hitting disk. innodb_buffer_pool_instances Starts with 8, maximum is 64. If buffer pool > 8G, starts with 8. Go with 16, 32, 64 incremental if necessary. Specify a combination of innodb_buffer_pool_instances and innodb_buffer_pool_size so that each buffer pool instance is at least 1 GB. tx_isolation 'READ-COMMITTED' Transaction isolation level recommended by Nextcloud. innodb_io_capacity ● SATA SSD starts with 1000 ● NVMe starts with 10000 The default value 200. Should be set to around the number of IOPS that system can handle. Ideally, opt for a lower setting, as at higher value data is removed from the buffers too quickly, reducing the effectiveness of caching. innodb_io_capacity_max ● SATA SSD starts with 4000 ● NVMe starts with 20000 The default value 2000. Hard limit of innodb_io_capacity. innodb_flush_method 'O_DIRECT' Default is fsync. Use this if the MariaDB data directory is located on a direct physical disk. *Based on MariaDB 10.5.4 default values. InnoDB Tuning (1 of 2)
  • 36. Copyright 2021 Severalnines AB Parameter Recommended Value Justification innodb_read_io_threads Number of CPU cores Default is 4. Max is 64. The total number of innodb_*_io_threads should not surpass the total number of CPU cores available to MariaDB. innodb_write_io_threads Number of CPU cores Default is 4. Max is 64. The total number of innodb_*_io_threads should not surpass the total number of CPU cores available to MariaDB. innodb_log_file_size 512M Default is 96M. The larger the value, the less checkpoint flush activity is required in the buffer pool, saving disk I/O with a tradeoff of slower recovery. However, it doesn't really matter in Galera since we have other operational nodes to cover the service availability while the node is recovering. innodb_flush_log_at_trx_commit 0 Default is 1 for full durability. This can be relaxed in Galera, since we always have other nodes to cover write durability. Set to 0 so InnoDB log buffer is written to file once per second. Up to 100% to 200% improvement. *Based on MariaDB 10.5.4 default values. InnoDB Tuning (2 of 2)
  • 37. Copyright 2021 Severalnines AB InnoDB Buffer Pool Best Practice • Reading a row from disk is about 100,000 times slower than reading the same row from RAM. • Therefore, InnoDB uses its own buffer, innodb_buffer_pool_size as the "working area". • The first read of data copies the data to RAM, and then subsequent reads take advantage of the faster performance of RAM. • Basic rule-of-thumb: ◦ If your database size can fit into the buffer pool size, MariaDB will very likely not hitting the disk. ◦ Try to reach 1000/1000 in the buffer pool hit rate. 37 mysql> SHOW ENGINE INNODB STATUSG ... ---------------------- BUFFER POOL AND MEMORY ---------------------- ... Buffer pool hit rate 929 / 1000 ... ... The hit rate of 929 / 1000 indicates that out of 1000 row reads, it was able to read the row in RAM 929 times. The remaining 71 times, it had to read the row of data from disk. This is not a bad ratio, but if your frequently-accessed data fits fully in RAM, you'll see this ratio increase to 999 / 1000 or even round up to 1000 / 1000.
  • 38. Copyright 2021 Severalnines AB Parameter Recommended Value Justification wsrep_slave_threads Number of CPU cores x 2 The minimum value for the slave threads should be 2 x number of CPU cores, and must not exceed the wsrep_cert_deps_distance value. wsrep_provider_options "gcache.size=2G" Default is 128M. The bigger gcache size, the higher chance of a joiner can join with incremental state transfer (IST). IST is faster and lesser impact than full syncing (SST). *Based on MariaDB 10.5.4 default values. Galera Tuning 38
  • 39. Copyright 2021 Severalnines AB ● If you opt for multi-writer Galera setup, make sure every table has an explicit primary key defined. ○ Some tables in Nextcloud do not have a PK defined. Simply add a primary key with auto-increment column. ● DDL operations (ALTER, CREATE, TRUNCATE, DROP) might cause the cluster to stall (wsrep_OSU_method is 'TOI') until the operation completes. ○ Perform NextCloud upgrade (commonly contains DDL operations) during a maintenance window, or low-peak hours or use online schema change tools like pt-online- schema-change. ● Due to flow-control, if one of the nodes slows down, very likely the replication performance will slow down as well. ○ Run heavy operations like backup, reporting or analytics during low-peak hours. ○ Attach an asynchronous replication slave, replicate from one of the Galera nodes. /* Get tables without primary keys */ SELECT DISTINCT CONCAT(t.table_schema,'.',t.table_name) AS tbl, t.engine, IF(ISNULL(c.constraint_name),'NOPK','') AS nopk, IF(s.index_type = 'FULLTEXT','FULLTEXT','') AS ftidx, IF(s.index_type = 'SPATIAL','SPATIAL','') AS gisidx FROM information_schema.tables AS t LEFT JOIN information_schema.key_column_usage AS c ON (t.table_schema = c.constraint_schema AND t.table_name = c.table_name AND c.constraint_name = 'PRIMARY') LEFT JOIN information_schema.statistics AS s ON (t.table_schema = s.table_schema AND t.table_name = s.table_name AND s.index_type IN ('FULLTEXT','SPATIAL')) WHERE t.table_schema NOT IN ('information_schema','performance_schema','mysql') AND t.table_type = 'BASE TABLE' AND (t.engine <> 'InnoDB' OR c.constraint_name IS NULL OR s.index_type IN ('FULLTEXT','SPATIAL')) ORDER BY t.table_schema,t.table_name; /* Add an auto-increment primary key */ ALTER TABLE nextcloud.oc_collres_accesscache ADD COLUMN `id` INT PRIMARY KEY AUTO_INCREMENT; Galera Best Practice 39
  • 40. Copyright 2021 Severalnines AB ● Enable Redis to offload the database cluster from handling the transactional file locking job. ● A performance boost on installations going from tens of thousands to hundreds of thousands of users ○ E.g, when editing a single text file, the database writes decreases by ~40-50% (26 writes vs 14 writes). ○ Reduce write contention on table oc_file_locks. ● Package php-redis must be installed ○ If Redis is running on the same system as Nextcloud, configure it to listen on an Unix socket. ○ Redis Cluster is also supported, while authentication requires php-redis 4.2.1+. ○ With cluster-mode enabled, there is no need to use a load balancer since php-redis is already cluster-aware (php-redis 3.0.0+). ● You can also use Redis as PHP sessions handler (requires changes to php.ini). // Nextcloud config.php 'filelocking.enabled' => true, 'memcache.locking' => 'OCMemcacheRedis', 'memcache.distributed' => 'OCMemcacheRedis', 'redis' => [ 'host' => '/var/run/redis/redis.sock', 'port' => 0, ], // Nextcloud config.php 'redis.cluster' => [ 'seeds' => [ '192.168.10.101:6379', '192.168.10.103:6379', '192.168.10.102:6379', ], 'timeout' => 0.0, 'read_timeout' => 0.0, 'failover_mode' => RedisCluster::FAILOVER_ERROR, 'password' => '', ], // php.ini session.save_handler = 'redis';// or 'rediscluster' session.save_path = 'tcp://127.0.0.1:6379' Caching 40