SlideShare a Scribd company logo
Optimizing
MARIADB for
Maximum Performance
Manjot Singh
Enterprise Architect
MariaDB Corporation
Optimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performance
What to Examine?
System MariaDB Server
Storage
Engines
Data and Query
Design
Applications
and Users
Business Problems
Applications
and Users
Application Problems
Applications
and Users
MariaDbDataSource vs MariaDbPoolDataSource
maxPoolSize and minPoolSize
COMMIT or ROLLBACK
Hardware
System
Operating System
System
# sysctl -w vm.swappiness=1
# echo "vm.swappiness=1" >> /etc/sysctl.conf
# echo noop > /sys/block/sda/queue/scheduler
Operating System
System
# cat /etc/security/limits.conf
mysql soft nofile 65535
mysql hard nofile 65535
# cat /etc/fstab
... rw,noatime,nodiratime,data=writeback ...
Carefully Adjusting Flavors
In Multiple Dishes
MariaDB Server
Server Variables
MariaDB Server
max_allowed_packet = e.g. 128G-256G
thread_handling = pool-of-threads
thread_pool_size = # of cpu cores
thread_pool_max_threads = 65536
thread_pool_min_threads = e.g. 8
thread_pool_idle_timeout = 60
max_connections = e.g. 2000-10000
Server Variables
MariaDB Server query_cache_size = 0
query_cache_type = 0
skip_name_resolv = ON
thread_cache_size = DON'T SET (Auto)
sync_binlog = e.g. 1000
PURPOSE-BUILT
STORAGE
InnoDB
Multipurpose Storage
Storage
Engines
InnoDB
Multipurpose Storage
Storage
Engines
innodb_buffer_pool_size = e.g. 256M-900G
((Total RAM
- (OS + Apps)
- (mysqld memory + query buffers)
- caches for things like binary log
- other possible buffers and caches
- memory tables)
/ 105% ) | ROUND_DOWN()
ROUND(192G
- ~10G
- ~4G
- ~1G
- ~2G
- ~3G)
= 168G
InnoDB
Multipurpose Storage
Storage
Engines
innodb_buffer_pool_size = e.g. 256M-900G
innodb_log_file_size = e.g. 2G-16G
innodb_stats_on_metadata = 0
innodb_flush_log_at_trx_commit = e.g. 0? (IFLATC)
InnoDB
Multipurpose Storage
Storage
Engines
innodb_flush_method = O_DIRECT
innodb_io_capacity = e.g. 2000
innodb_adaptive_hash_index_parts = e.g. 2-8
btr0sea.c
InnoDB
Multipurpose Storage
Storage
Engines
innodb_autoinc_lock_mode = e.g. 2
innodb_flush_neighbors = e.g. 0 w/SSD
innodb_lru_scan_depth = e.g. 4096
innodb_sync_array_size = e.g. 16-32
(but < # of cpu cores)
InnoDB
Multipurpose Storage
Storage
Engines
innodb_read_io_threads = 4
innodb_write_io_threads = 4
History list length
ROW_FORMAT=DYNAMIC OR COMPRESSED
MyRocks
Writes and Compression
Storage
Engines
MyRocks
Writes and Compression
Storage
Engines
rocksdb_block_cache_size = e.g. 256M-900G
Rocksdb_default_cf_options =
"compaction_pri=kMinOverlappingRatio;
level_compaction_dynamic_level_bytes=true;"
rocksdb_max_background_jobs = (# cpu cores / 4)
MyRocks
Writes and Compression
Storage
Engines
Rocksdb_default_cf_options =
"block_based_table_factory=
{cache_index_and_filter_blocks=1;
filter_policy=bloomfilter:10:false;
whole_key_filtering=1};"
MyRocks
Writes and Compression
Storage
Engines
log-bin = 1
rocksdb_flush_log_at_trx_commit = e.g. 0?
MyRocks
Writes and Compression
Storage
Engines
latin1_bin, utf8_bin, binary
INDEX index_name(col1, ...) COMMENT 'family_name'
rocksdb_max_open_files = -1
MyRocks
Writes and Compression
Storage
Engines
SET session sql_log_bin=0;
SET session rocksdb_bulk_load_allow_unsorted=1;
SET session rocksdb_bulk_load=1;
SET session rocksdb_commit_in_the_middle=1;
...
SET session rocksdb_bulk_load=0;
SET session rocksdb_bulk_load_allow_unsorted=0;
Aria
System and Temp
Storage
Engines
Aria
System and Temp
Storage
Engines
aria_pagecache_buffer_size = e.g. 256M-64G
aria_block_size = e.g. 2048-8096
aria_group_commit = "hard"
aria_group_commit_interval = 0
Aria
System and Temp
Storage
Engines
aria_pagecache_file_hash_size = e.g. 10% open files
aria_repair_threads = e.g. 4
Schema Schmema
Data and Query
Design
SELECT col1 FROM t1
PROCEDURE ANALYSE() G
What the Query?
Data and Query
Design
Look it Up
Data and Query
Design
Place Image HereTake Another Look
THANK YOU!
Questions
THANK YOU!

More Related Content

PPTX
MySQL_MariaDB-성능개선-202201.pptx
PPTX
Maxscale 소개 1.1.1
PDF
Maxscale switchover, failover, and auto rejoin
PPTX
ProxySQL for MySQL
PPTX
MaxScale이해와활용-2023.11
PDF
MariaDB MaxScale
PDF
MariaDB Server Performance Tuning & Optimization
DOCX
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
MySQL_MariaDB-성능개선-202201.pptx
Maxscale 소개 1.1.1
Maxscale switchover, failover, and auto rejoin
ProxySQL for MySQL
MaxScale이해와활용-2023.11
MariaDB MaxScale
MariaDB Server Performance Tuning & Optimization
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx

What's hot (20)

PDF
MariaDB Performance Tuning and Optimization
PDF
The Full MySQL and MariaDB Parallel Replication Tutorial
PDF
High Availability PostgreSQL with Zalando Patroni
PDF
Solving PostgreSQL wicked problems
PDF
MySQL Advanced Administrator 2021 - 네오클로바
ODP
PostgreSQL Administration for System Administrators
PDF
Maxscale_메뉴얼
PDF
M|18 Architectural Overview: MariaDB MaxScale
PPTX
Maria DB Galera Cluster for High Availability
PDF
Best practices for MySQL High Availability
PDF
MySQL Shell for DBAs
PDF
Using all of the high availability options in MariaDB
PDF
Under the Hood of a Shard-per-Core Database Architecture
PDF
ProxySQL High Avalability and Configuration Management Overview
PDF
MariaDB 10.5 binary install (바이너리 설치)
PDF
Redo log improvements MYSQL 8.0
PDF
MySQL Administrator 2021 - 네오클로바
PDF
MariaDB MaxScale monitor 매뉴얼
PDF
PostgreSQL replication
PDF
Performance tuning in BlueStore & RocksDB - Li Xiaoyan
MariaDB Performance Tuning and Optimization
The Full MySQL and MariaDB Parallel Replication Tutorial
High Availability PostgreSQL with Zalando Patroni
Solving PostgreSQL wicked problems
MySQL Advanced Administrator 2021 - 네오클로바
PostgreSQL Administration for System Administrators
Maxscale_메뉴얼
M|18 Architectural Overview: MariaDB MaxScale
Maria DB Galera Cluster for High Availability
Best practices for MySQL High Availability
MySQL Shell for DBAs
Using all of the high availability options in MariaDB
Under the Hood of a Shard-per-Core Database Architecture
ProxySQL High Avalability and Configuration Management Overview
MariaDB 10.5 binary install (바이너리 설치)
Redo log improvements MYSQL 8.0
MySQL Administrator 2021 - 네오클로바
MariaDB MaxScale monitor 매뉴얼
PostgreSQL replication
Performance tuning in BlueStore & RocksDB - Li Xiaoyan
Ad

Similar to Optimizing MariaDB for maximum performance (20)

PDF
Configuring workload-based storage and topologies
PDF
MySQL Tokudb engine benchmark
PDF
Experiences with Oracle SPARC S7-2 Server
PDF
MariaDB Paris Workshop 2023 - Performance Optimization
ODP
Exploiting Your File System to Build Robust & Efficient Workflows
PDF
MySQL Performance Metrics that Matter
PDF
MySQL User Group NL - MySQL 8
PDF
MySQL configuration - The most important Variables
PPTX
Scaling MongoDB
PPTX
Get expertise with mongo db
PPTX
MySQL Tips for WordPress
KEY
Tek tutorial
PDF
MySQL performance webinar
PDF
Introduction to MariaDB
PDF
介绍 Percona 服务器 XtraDB 和 Xtrabackup
PPTX
Super scaling singleton inserts
PDF
MySQL Oslayer performace optimization
PDF
MySQL 5.5&5.6 new features summary
KEY
DPC Tutorial
PPTX
How sitecore depends on mongo db for scalability and performance, and what it...
Configuring workload-based storage and topologies
MySQL Tokudb engine benchmark
Experiences with Oracle SPARC S7-2 Server
MariaDB Paris Workshop 2023 - Performance Optimization
Exploiting Your File System to Build Robust & Efficient Workflows
MySQL Performance Metrics that Matter
MySQL User Group NL - MySQL 8
MySQL configuration - The most important Variables
Scaling MongoDB
Get expertise with mongo db
MySQL Tips for WordPress
Tek tutorial
MySQL performance webinar
Introduction to MariaDB
介绍 Percona 服务器 XtraDB 和 Xtrabackup
Super scaling singleton inserts
MySQL Oslayer performace optimization
MySQL 5.5&5.6 new features summary
DPC Tutorial
How sitecore depends on mongo db for scalability and performance, and what it...
Ad

More from MariaDB plc (20)

PDF
MariaDB Berlin Roadshow Slides - 8 April 2025
PDF
MariaDB München Roadshow - 24 September, 2024
PDF
MariaDB Paris Roadshow - 19 September 2024
PDF
MariaDB Amsterdam Roadshow: 19 September, 2024
PDF
MariaDB Paris Workshop 2023 - MaxScale 23.02.x
PDF
MariaDB Paris Workshop 2023 - Newpharma
PDF
MariaDB Paris Workshop 2023 - Cloud
PDF
MariaDB Paris Workshop 2023 - MariaDB Enterprise
PDF
MariaDB Paris Workshop 2023 - MaxScale
PDF
MariaDB Paris Workshop 2023 - novadys presentation
PDF
MariaDB Paris Workshop 2023 - DARVA presentation
PDF
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
PDF
MariaDB SkySQL Autonome Skalierung, Observability, Cloud-Backup
PDF
Einführung : MariaDB Tech und Business Update Hamburg 2023
PDF
Hochverfügbarkeitslösungen mit MariaDB
PDF
Die Neuheiten in MariaDB Enterprise Server
PDF
Global Data Replication with Galera for Ansell Guardian®
PDF
Introducing workload analysis
PDF
Under the hood: SkySQL monitoring
PDF
Introducing the R2DBC async Java connector
MariaDB Berlin Roadshow Slides - 8 April 2025
MariaDB München Roadshow - 24 September, 2024
MariaDB Paris Roadshow - 19 September 2024
MariaDB Amsterdam Roadshow: 19 September, 2024
MariaDB Paris Workshop 2023 - MaxScale 23.02.x
MariaDB Paris Workshop 2023 - Newpharma
MariaDB Paris Workshop 2023 - Cloud
MariaDB Paris Workshop 2023 - MariaDB Enterprise
MariaDB Paris Workshop 2023 - MaxScale
MariaDB Paris Workshop 2023 - novadys presentation
MariaDB Paris Workshop 2023 - DARVA presentation
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB SkySQL Autonome Skalierung, Observability, Cloud-Backup
Einführung : MariaDB Tech und Business Update Hamburg 2023
Hochverfügbarkeitslösungen mit MariaDB
Die Neuheiten in MariaDB Enterprise Server
Global Data Replication with Galera for Ansell Guardian®
Introducing workload analysis
Under the hood: SkySQL monitoring
Introducing the R2DBC async Java connector

Recently uploaded (20)

PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
System and Network Administraation Chapter 3
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
top salesforce developer skills in 2025.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Transform Your Business with a Software ERP System
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
history of c programming in notes for students .pptx
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
System and Network Administraation Chapter 3
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Upgrade and Innovation Strategies for SAP ERP Customers
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
top salesforce developer skills in 2025.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Understanding Forklifts - TECH EHS Solution
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Design an Analysis of Algorithms II-SECS-1021-03
How to Migrate SBCGlobal Email to Yahoo Easily
Transform Your Business with a Software ERP System
Which alternative to Crystal Reports is best for small or large businesses.pdf
Odoo Companies in India – Driving Business Transformation.pdf
PTS Company Brochure 2025 (1).pdf.......
history of c programming in notes for students .pptx
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
How Creative Agencies Leverage Project Management Software.pdf
Softaken Excel to vCard Converter Software.pdf

Optimizing MariaDB for maximum performance