SlideShare a Scribd company logo
1 of 43
Download to read offline
MariaDB Server
performance tuning
&
optimization
James McLaurin
Solution Architect
MariaDB
Agenda
MariaDB Performance Tuning:
– Common Principles and Best Practices
– Server Hardware and OS
– MariaDB Configuration Settings
– Database Monitoring
– Query Tuning
Blog: https://mariadb.com/resources/blog/20-tips-prepare-your-database-black-friday-cyber-monday
Why Tune?
The task of scalable server software is to maintain top performance for an
increasing number of clients.
● Make efficient use of server resources
● Best performance for users
● Avoid outages due to server slowness
● Capacity
○ Be Prepared for Application Development Requirements
○ Allow for Unexpected Traffic Spikes or Other Changes in Demand
Tune what?
Initial recommended values for performance:
● transaction-isolation = READ-COMMITTED
● key_buffer – 128MB for every 1GB of RAM
● sort_buffer_size – 1MB for every 1GB of RAM
● read_buffer_size – 1MB for every 1GB of RAM
● read_rnd_buffer_size – 1MB for every 1GB of RAM
● thread_concurrency – is based on the number of CPUs so make it CPU*2
● thread-handling=pool-of-threads
● innodb_flush_log_at_trx_commit != 1 – speed changes spectacularly if it’s !=1
● open_files_limit = 50000
Tune what?
● Configuring threadpool
○ Pool-of-threads, or threadpool, is a MariaDB feature that improves
performance by pooling active threads together instead of the old one thread per
client connection method, which does not scale well for typical web-based
workloads with many short-running queries.
● Change innodb_flush_log_at_trx_commit to something !=1
○ speed changes spectacularly if it is !=1
● The more memory available … the better
The “performance values”
MariaDB performance parameters:
● InnoDB file-per-table
● InnoDB Buffer Pool Size
● Disable Swappiness In MariaDB
● Max Connections
● Thread Cache Size
● Disable MySQL DNS Lookups
● Query Cache Size
● Tmp Table Size & Max Heap Table Size
● Slow Query Logs
● Idle Connections
Performance
Common Principles and Best Practices
Tuning Routine - When to Tune
• Use Monitoring Tool - MonYog
• Tune from Start of the Application Lifecycle
– Start Early to Ensure Schema is Well Constructed
– Test Queries on Real Data — Watch for Bottlenecks
– Over Tuning without Production Data or Traffic is Counter Productive
• Conduct Periodic Reviews of Production Systems
– Watch for Schema, Query and Significant Changes
– Check Carefully New Application Features
– Monitor System Resources — Disk, Memory, Network, CPU
my.cnf
configuration file
• Change one setting at a time...
– This is the only way to determine if a change is beneficial.
• Most settings can be changed at runtime with SET GLOBAL.
– It is very handy and it allows you to quickly revert the change if needed.
– To make the change permanent, you need to update the configuration file.
• If a change in the configuration is not visible even after a MariaDB restart…
– Did you use the correct configuration file?
– Did you put the setting in the right section?
•Normally the [mysqld] section for these settings
my.cnf
configuration file
• The server refuses to start after a change:
– Did you use the correct units?
•For instance, innodb_buffer_pool_size should be set in bytes
while max_connection is dimensionless.
• Do not allow duplicate settings in the configuration file.
– If you want to keep track of the changes, use version control.
• Don’t do naive math, like “my new server has 2x RAM, it’ll just make all the values
2x the previous ones”.
Performance
Server Hardware and OS Tuning
Server Hardware
• One Service per Server is Ideal to Prevent Contention
– Have the database server be only a database server etc.
• More CPU Cores is generally Good
• More Disk is usually Better
– Large Datasets, Fast Disks are Ideal
• More RAM is usually Best — Traffic Dependent
– More of Dataset in Memory, Fewer Slow Disk Operations
OS Settings
Linux Settings
•Swappiness
○ Value for propensity of the OS to swap
to disk
○ Defaults are usually 60
○ Commonly set low to 10 or so (not 0)
•Noatime
○ Mount disks with this option
○ Turns off writing of access time to disk
with every file access
○ Without this option every read becomes
an additional write
Performance
MariaDB Configuration Settings
Configuration Settings
innodb_buffer_pool_size
•The first setting to update
•The buffer pool is where data and indexes
are cached
• Utilize memory for read operations rather
than disk
•80% RAM rule of thumb
•Typical values are
✓ 5-6GB (8GB RAM)
✓ 20-25GB (32GB RAM)
✓ 100-120GB (128GB RAM)
Configuration Settings
query_cache_size
● Query cache is a well known bottleneck
● Consider setting query_cache_size = 0
● Use other ways to speed up read
queries:
○ Good indexing
○ Adding replicas to spread the read
load
Configuration Settings
innodb_log_file_size
● Size of the redo logs - 25 to 50% of
innodb_buffer_pool usually
recommended
● Redo logs are used to make sure writes
are fast and durable and also during
crash recovery
● Larger log files can lead to slower
recovery in the event of a server crash
● But! Larger log files also reduce the
number of checkpoints needed and
reduce disk I/O
Configuration Settings
innodb_file_per_table
● Each .ibd file represents a tablespace of its
own.
● Database operations such as “TRUNCATE”
can be completed faster and you may also
reclaim unused space when dropping or
truncating a database table.
● Allows some of the database tables to be
kept in separate storage device. This can
greatly improve the I/O load on your disks.
Configuration Settings
Disable MySQL Reverse
DNS Lookups
● MariaDB performs a DNS lookup of the
user’s IP address and Hostname with
connection
● The IP address is checked by resolving it to a
host name. The hostname is then resolved to
an IP to verify
● This allows DNS issues to cause delays
● You can disable and use IP addresses only
○ skip-name-resolve under [mysqld] in
my.cnf
Configuration Settings
max_connections •‘Too many connections’ error?
•Using a connection pool at the application
level or a thread pool at the MariaDB level
can help
Configuration Settings
Check for MySQL idle
Connections
● Idle connections consume resources and
should be interrupted or refreshed when
possible.
● Idle connections are in “sleep” state and
usually stay that way for long period of time.
● To look for idled connections:
● # mysqladmin processlist -u root -p | grep
“Sleep”
● You can check the code for the cause if many
idled
● You can also change the wait_timeout value
Configuration Settings
thread_cache_size
● The thread_cache_size directive sets the amount of
threads that your server should cache.
● To find the thread cache hit rate, you can use the
following technique:
○ show status like 'Threads_created';
○ show status like 'Connections';
● calculate the thread cache hit rate percentage:
○ 100 - ((Threads_created / Connections) * 100)
● Dynamically set to a new value:
○ set global thread_cache_size = 16;
Configuration Settings
memory parameters
● MariaDB uses temporary tables when
processing complex queries involving joins
and sorting
● The default size of a temporary table is very
small
○ The size is configured in your my.cnf:
tmp-table-size = 1G
max-heap-table-size = 1G
● Both should have the same size and will help
prevent disk writes
● A rule of thumb is giving 64Mb for every GB
of RAM on the server
Configuration Settings
Buffer Sizes
● join buffer size
○ used to process joins – but only full
joins on which no keys are possible
● sort buffer size
○ Sort buffer size is used to sort data.
○ The system status variable
sort_merge_passes will indicates need
to increase
○ This variable should be as low as
possible.
● These buffers are allocated per connection
and play a significant role in the
performance of the system.
Configuration Settings
max_allowed_packet
● MariaDB splits data into packets. Usually a
single packet is considered a row that is sent
to a client.
● The max_allowed_packet directive defines
the maximum size of packet that can be sent.
● Setting this value too low can cause a query
to stall and you will receive an error in your
error log.
● It is recommended to set the value to the
size of your largest packet.
○ Some suggest 11 times the largest BLOB
Performance Monitoring
Database Monitoring
System Metrics
Metric Comments Suggested Alert
Load An all-in-one performance metric. When load is > factor x (number of
cores). Our suggested factor is 4.
CPU usage A high CPU usage is not a bad thing as long as you don’t reach the limit. None
Memory usage Ideally your entire database should be stored in memory, but this is not always
possible. Give MySQL as much as you can afford but leave enough for other
processes to function.
None
Swap usage Swap is for emergencies only, and it should not be used. When used swap is > 128MB.
Network bandwidth Unless doing backups or transferring huge amounts of data, it shouldn’t be the
bottleneck.
None
Disk usage Make sure you always have free space for new data, temporary files, snapshot or
backups.
When database, logs and temp is >
85% usage.
Disk Monitoring
Metric Comments Suggested Alert
Read/Write requests IOPS (Input/Output operations per second) None
IO Queue length Tracks how many operations are waiting for disk access. If a query hits the cache, it doesn’t create
any disk operation. If a query doesn’t hit the cache (i.e. a miss), it will create multiple disk operations.
None
Average IO wait Time that queue operations have to wait for disk access. None
Average Read/Write
time
Time it takes to finish disk access operations (latency). None
Read/Write bandwidth Data transfer from and towards your disk. None
MariaDB Metrics
Metric Comments Suggested Alert
Uptime Seconds since the server was started. We can use this to detect respawns. When uptime is < 180.
Threads_connected Number of clients currently connected. If none or too high, something is wrong. None
Max_used_connections Max number of connections at a time since server started.
(max_used_connections / max_connections) indicates if you could run out soon
of connection slots.
When connections usage is > 85%.
Aborted_connects Number of failed connection attempts. When growing over a period of time
either some credentials are wrong or we are being attacked.
When aborted connects/min > 3. (only
on not public exposed servers,
otherwise will generate noise)
MariaDB typical errors
common failure points to keep an eye on
Metric Comments Suggested Alert
(Errors) Are there any errors on the mysql.log file? None
(Log files size) Are all log files being rotated? None
(Deleted log files) Were any log files deleted but the file descriptor is still open? None
(Backup space) Do you have enough disk space for backups? None
Monitoring caches, buffers & locks
Metric Comments Suggested
Alert
Innodb_row_lock_waits Number of times InnoDB had to wait before locking a row. None
Innodb_buffer_pool_wait_free Number of times InnoDB had to wait for memory pages to be flushed. If too high,
innodb_buffer_pool_size is too small for current write load.
None
Open_tables Number of tables currently open. If this is low and table_cache is high, we can reduce cache
size. If opposite, we should increase it. If you increase table_cache you might have to increase
available file descriptors for the mysql user.
None
(Long running transactions) Tracks whether too many transactions are locked by other idle transactions, or because of a
problem in InnoDB.
None
(Deadlocks) Deadlocks happen when 2 transactions mutually hold. These are unavoidable in InnoDB and
apps should deal with them.
None
Monitoring Queries
Metric Comments Suggested Alert
Slow_queries Number of queries that took more than long_query_time seconds to execute. Slow queries
generate excessive disk reads, memory and CPU usage. Check slow_query_log to find them.
None
Select_full_join Number of full joins needed to answer queries. If too high, improve your indexing or database
schema.
None
Created_tmp_disk_tables Number of temporary tables (typically for joins) stored on slow spinning disks, instead of faster
RAM.
None
(Full table scans)
Handler_read%
Number of times the system reads the first row of a table index. Sequential reads might indicate
a faulty index.
None
Performance
Query Tuning
Query Tuning
Enable Slow query Logs
Logging slow queries can help you determine issues with your database and help you debug them. This can be easily
enabled by adding the following values in your my.cnf configuration file:
slow-query-log = 1
slow-query-log-file = /var/lib/mysql/mysql-slow.log
long_query_time = 1
The first directive enables the logging of slow queries, while the second one tells MariaDB where to store the actual
log file. Use long_query_time to define the amount of time that is considered long for a MariaDB query to be completed.
EXPLAIN SELECT *
FROM employees
WHERE
MONTH(birth_date)
= 8 G
id: 1
select_type: SIMPLE
table: employees
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 299587
Extra: Using where
Query Tuning
Query Analysis ● Use the Slow Log to find Problem Queries
● Use mysqldumpslow Utility for Manageable
Reports
● Use EXPLAIN to see how MariaDB Executes a
Troublesome Query and if Indexes are Used
● Use EXPLAIN EXTENDED and SHOW
WARNINGS to see how MariaDB Rearranges a
Query before Execution
EXPLAIN SELECT * FROM employees
WHERE MONTH(birth_date) = 8 G
id: 1
select_type: SIMPLE
table: employees
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 299587
Extra: Using where
EXPLAIN SELECT *
FROM employees
WHERE
MONTH(birth_date)
= 8 G
id: 1
select_type: SIMPLE
table: employees
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 299587
Extra: Using where
Query Tuning
Query Tuning Overview
● Try Not to Query Tune on Production Server
● Use Test Server with same Hardware and OS
● Use Copy of Production Data Set
● Query Frequency is as Important as Query
Speed
○ Moderately Slow Queries are often a Bigger
Problem than a Rarely Run Very Slow Query
EXPLAIN SELECT *
FROM employees
WHERE
MONTH(birth_date)
= 8 G
id: 1
select_type: SIMPLE
table: employees
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 299587
Extra: Using where
Query Tuning
Indexing
● Indexes Improve Read Performance
● Without Index, MariaDB Must Read Every Row —
Full Table Scan
● With Index, MariaDB can jump to Requested
Rows
● Reduced I/O and Improving Performance
● Index Increase cost of Writes
● Find Balance
● Index for Speed, but Avoid Indexing Excessively
or Arbitrarily
● Remove Dead or Redundant Indexes
EXPLAIN SELECT *
FROM employees
WHERE
MONTH(birth_date)
= 8 G
id: 1
select_type: SIMPLE
table: employees
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 299587
Extra: Using where
Query Tuning
Index Size
● Keep Indexes as Small as Practical
○ Faster since More Likely to Fit in Memory
○ Rebuilds Faster after Writes
○ PRIMARY KEY should be Minimum Useful
Size
● Use Partial Prefix Indexes for String Columns
○ May Slow Searches Slightly, but Reduce
Index Size
● Use Index Cardinality (Uniqueness Measure)
Only If Necessary — Re-evaluate as Data Grows
○ Low Cardinality Indicates many Duplicates
○ High Cardinality is More Useful
EXPLAIN SELECT *
FROM employees
WHERE
MONTH(birth_date)
= 8 G
id: 1
select_type: SIMPLE
table: employees
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 299587
Extra: Using where
Query Tuning
Tools & Statistics
● Identify Accurately and Carefully Trouble Spots
○ Guessing is Rarely Useful
● Gather Performance Stats with MariaDB and OS
Tools
○ SHOW Statements
○ PERFORMANCE_SCHEMA
○ CPU, Disk, Network, Memory, & Swap Stats
● Retain Snapshots of Multiple Stats
○ Data from a Single Point Shows very Little
● Automate the Collection of Stats into Logs
○ Can be Useful for Emergency Tuning
EXPLAIN SELECT *
FROM employees
WHERE
MONTH(birth_date)
= 8 G
id: 1
select_type: SIMPLE
table: employees
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 299587
Extra: Using where
Query Tuning
SHOW PROCESSLIST
● Snapshot of mysqld Activity
● mysqld is Multi-Threaded, One Thread per
○ Client Connection (i.e., query, transaction) —
a "process" is a "thread"
● Accumulate SHOW PROCESSLIST Snapshots to
build History of Thread Activities
EXPLAIN SELECT *
FROM employees
WHERE
MONTH(birth_date)
= 8 G
id: 1
select_type: SIMPLE
table: employees
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 299587
Extra: Using where
Query Tuning
SHOW STATUS
Global or Session
● Returns List of Internal Counters
● GLOBAL for System-Wide Status — Since
Start-Up
● SESSION for Local to Client Connection
● FLUSH STATUS Resets Local Counters
● Monitor Changes to Counters to Identify Hot
Spots
● Collect Periodically Status Snapshots to Profile
Traffic
EXPLAIN SELECT *
FROM employees
WHERE
MONTH(birth_date)
= 8 G
id: 1
select_type: SIMPLE
table: employees
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 299587
Extra: Using where
Query Tuning
PERFORMANCE_SCHEMA
● Similar to INFORMATION_SCHEMA , but
Performance Tuning
● Monitors MariaDB Server Events
● Function Calls, Operating System Waits, Internal
Mutexes, I/O Calls
● Detailed Query Execution Stages (Parsing,
Statistics, Sorting)
● Some Features Storage Engine Specific
● Monitoring Lightweight and Requires No
Dedicated Thread
● Designed to be Used Iteratively with Successive
Refinement
Thank you
james.mclaurin@mariadb.com.

More Related Content

What's hot

Using all of the high availability options in MariaDB
Using all of the high availability options in MariaDBUsing all of the high availability options in MariaDB
Using all of the high availability options in MariaDBMariaDB plc
 
New optimizer features in MariaDB releases before 10.12
New optimizer features in MariaDB releases before 10.12New optimizer features in MariaDB releases before 10.12
New optimizer features in MariaDB releases before 10.12Sergey Petrunya
 
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é
 
MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)Colin Charles
 
MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바NeoClova
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바NeoClova
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBMydbops
 
MariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationMariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationFrancisco Gonçalves
 
Intro to MySQL Master Slave Replication
Intro to MySQL Master Slave ReplicationIntro to MySQL Master Slave Replication
Intro to MySQL Master Slave Replicationsatejsahu
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleColin Charles
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼NeoClova
 
Replication Troubleshooting in Classic VS GTID
Replication Troubleshooting in Classic VS GTIDReplication Troubleshooting in Classic VS GTID
Replication Troubleshooting in Classic VS GTIDMydbops
 
MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11NeoClova
 
Best Practice for Achieving High Availability in MariaDB
Best Practice for Achieving High Availability in MariaDBBest Practice for Achieving High Availability in MariaDB
Best Practice for Achieving High Availability in MariaDBMariaDB plc
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleMariaDB plc
 
Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기NeoClova
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyJean-François Gagné
 
MySQL Timeout Variables Explained
MySQL Timeout Variables Explained MySQL Timeout Variables Explained
MySQL Timeout Variables Explained Mydbops
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsJean-François Gagné
 

What's hot (20)

Using all of the high availability options in MariaDB
Using all of the high availability options in MariaDBUsing all of the high availability options in MariaDB
Using all of the high availability options in MariaDB
 
New optimizer features in MariaDB releases before 10.12
New optimizer features in MariaDB releases before 10.12New optimizer features in MariaDB releases before 10.12
New optimizer features in MariaDB releases before 10.12
 
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)
 
MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)
 
Introduction to Galera Cluster
Introduction to Galera ClusterIntroduction to Galera Cluster
Introduction to Galera Cluster
 
MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
 
MariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationMariaDB Galera Cluster presentation
MariaDB Galera Cluster presentation
 
Intro to MySQL Master Slave Replication
Intro to MySQL Master Slave ReplicationIntro to MySQL Master Slave Replication
Intro to MySQL Master Slave Replication
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼
 
Replication Troubleshooting in Classic VS GTID
Replication Troubleshooting in Classic VS GTIDReplication Troubleshooting in Classic VS GTID
Replication Troubleshooting in Classic VS GTID
 
MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11
 
Best Practice for Achieving High Availability in MariaDB
Best Practice for Achieving High Availability in MariaDBBest Practice for Achieving High Availability in MariaDB
Best Practice for Achieving High Availability in MariaDB
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
 
Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash Safety
 
MySQL Timeout Variables Explained
MySQL Timeout Variables Explained MySQL Timeout Variables Explained
MySQL Timeout Variables Explained
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitations
 

Similar to MariaDB Server Performance Tuning & Optimization

Maximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMaximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMariaDB plc
 
Maximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMaximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMariaDB plc
 
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar Ahmed
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar AhmedPGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar Ahmed
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar AhmedEqunix Business Solutions
 
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
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014Ryusuke Kajiyama
 
Loadays MySQL
Loadays MySQLLoadays MySQL
Loadays MySQLlefredbe
 
Proper Care and Feeding of a MySQL Database for Busy Linux Administrators
Proper Care and Feeding of a MySQL Database for Busy Linux AdministratorsProper Care and Feeding of a MySQL Database for Busy Linux Administrators
Proper Care and Feeding of a MySQL Database for Busy Linux AdministratorsDave Stokes
 
The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...
The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...
The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...Dave Stokes
 
Performance Whack-a-Mole Tutorial (pgCon 2009)
Performance Whack-a-Mole Tutorial (pgCon 2009) Performance Whack-a-Mole Tutorial (pgCon 2009)
Performance Whack-a-Mole Tutorial (pgCon 2009) PostgreSQL Experts, Inc.
 
Oracle Performance On Linux X86 systems
Oracle  Performance On Linux  X86 systems Oracle  Performance On Linux  X86 systems
Oracle Performance On Linux X86 systems Baruch Osoveskiy
 
Tuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadTuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadMarius Adrian Popa
 
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux AdminsLinuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux AdminsDave Stokes
 
Taking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionTaking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionSplunk
 
Colvin exadata mistakes_ioug_2014
Colvin exadata mistakes_ioug_2014Colvin exadata mistakes_ioug_2014
Colvin exadata mistakes_ioug_2014marvin herrera
 
071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephenSteve Feldman
 
Storage talk
Storage talkStorage talk
Storage talkchristkv
 

Similar to MariaDB Server Performance Tuning & Optimization (20)

Maximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMaximizing performance via tuning and optimization
Maximizing performance via tuning and optimization
 
Maximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMaximizing performance via tuning and optimization
Maximizing performance via tuning and optimization
 
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar Ahmed
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar AhmedPGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar Ahmed
PGConf.ASIA 2019 Bali - Tune Your LInux Box, Not Just PostgreSQL - Ibrar Ahmed
 
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
 
Performance tuning in sql server
Performance tuning in sql serverPerformance tuning in sql server
Performance tuning in sql server
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
 
Performance Whackamole (short version)
Performance Whackamole (short version)Performance Whackamole (short version)
Performance Whackamole (short version)
 
Loadays MySQL
Loadays MySQLLoadays MySQL
Loadays MySQL
 
Proper Care and Feeding of a MySQL Database for Busy Linux Administrators
Proper Care and Feeding of a MySQL Database for Busy Linux AdministratorsProper Care and Feeding of a MySQL Database for Busy Linux Administrators
Proper Care and Feeding of a MySQL Database for Busy Linux Administrators
 
The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...
The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...
The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...
 
Performance Whack-a-Mole Tutorial (pgCon 2009)
Performance Whack-a-Mole Tutorial (pgCon 2009) Performance Whack-a-Mole Tutorial (pgCon 2009)
Performance Whack-a-Mole Tutorial (pgCon 2009)
 
Oracle Performance On Linux X86 systems
Oracle  Performance On Linux  X86 systems Oracle  Performance On Linux  X86 systems
Oracle Performance On Linux X86 systems
 
MySQL Tuning
MySQL TuningMySQL Tuning
MySQL Tuning
 
Tuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadTuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy Workload
 
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux AdminsLinuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
 
Taking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionTaking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout Session
 
Colvin exadata mistakes_ioug_2014
Colvin exadata mistakes_ioug_2014Colvin exadata mistakes_ioug_2014
Colvin exadata mistakes_ioug_2014
 
071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen
 
Storage talk
Storage talkStorage talk
Storage talk
 
Optimizing Linux Servers
Optimizing Linux ServersOptimizing Linux Servers
Optimizing Linux Servers
 

More from MariaDB plc

MariaDB Paris Workshop 2023 - MaxScale 23.02.x
MariaDB Paris Workshop 2023 - MaxScale 23.02.xMariaDB Paris Workshop 2023 - MaxScale 23.02.x
MariaDB Paris Workshop 2023 - MaxScale 23.02.xMariaDB plc
 
MariaDB Paris Workshop 2023 - Newpharma
MariaDB Paris Workshop 2023 - NewpharmaMariaDB Paris Workshop 2023 - Newpharma
MariaDB Paris Workshop 2023 - NewpharmaMariaDB plc
 
MariaDB Paris Workshop 2023 - Cloud
MariaDB Paris Workshop 2023 - CloudMariaDB Paris Workshop 2023 - Cloud
MariaDB Paris Workshop 2023 - CloudMariaDB plc
 
MariaDB Paris Workshop 2023 - MariaDB Enterprise
MariaDB Paris Workshop 2023 - MariaDB EnterpriseMariaDB Paris Workshop 2023 - MariaDB Enterprise
MariaDB Paris Workshop 2023 - MariaDB EnterpriseMariaDB plc
 
MariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance OptimizationMariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance OptimizationMariaDB plc
 
MariaDB Paris Workshop 2023 - MaxScale
MariaDB Paris Workshop 2023 - MaxScale MariaDB Paris Workshop 2023 - MaxScale
MariaDB Paris Workshop 2023 - MaxScale MariaDB plc
 
MariaDB Paris Workshop 2023 - novadys presentation
MariaDB Paris Workshop 2023 - novadys presentationMariaDB Paris Workshop 2023 - novadys presentation
MariaDB Paris Workshop 2023 - novadys presentationMariaDB plc
 
MariaDB Paris Workshop 2023 - DARVA presentation
MariaDB Paris Workshop 2023 - DARVA presentationMariaDB Paris Workshop 2023 - DARVA presentation
MariaDB Paris Workshop 2023 - DARVA presentationMariaDB plc
 
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
 
MariaDB SkySQL Autonome Skalierung, Observability, Cloud-Backup
MariaDB SkySQL Autonome Skalierung, Observability, Cloud-BackupMariaDB SkySQL Autonome Skalierung, Observability, Cloud-Backup
MariaDB SkySQL Autonome Skalierung, Observability, Cloud-BackupMariaDB plc
 
Einführung : MariaDB Tech und Business Update Hamburg 2023
Einführung : MariaDB Tech und Business Update Hamburg 2023Einführung : MariaDB Tech und Business Update Hamburg 2023
Einführung : MariaDB Tech und Business Update Hamburg 2023MariaDB plc
 
Hochverfügbarkeitslösungen mit MariaDB
Hochverfügbarkeitslösungen mit MariaDBHochverfügbarkeitslösungen mit MariaDB
Hochverfügbarkeitslösungen mit MariaDBMariaDB plc
 
Die Neuheiten in MariaDB Enterprise Server
Die Neuheiten in MariaDB Enterprise ServerDie Neuheiten in MariaDB Enterprise Server
Die Neuheiten in MariaDB Enterprise ServerMariaDB plc
 
Global Data Replication with Galera for Ansell Guardian®
Global Data Replication with Galera for Ansell Guardian®Global Data Replication with Galera for Ansell Guardian®
Global Data Replication with Galera for Ansell Guardian®MariaDB plc
 
Introducing workload analysis
Introducing workload analysisIntroducing workload analysis
Introducing workload analysisMariaDB plc
 
Under the hood: SkySQL monitoring
Under the hood: SkySQL monitoringUnder the hood: SkySQL monitoring
Under the hood: SkySQL monitoringMariaDB plc
 
Introducing the R2DBC async Java connector
Introducing the R2DBC async Java connectorIntroducing the R2DBC async Java connector
Introducing the R2DBC async Java connectorMariaDB plc
 
MariaDB Enterprise Tools introduction
MariaDB Enterprise Tools introductionMariaDB Enterprise Tools introduction
MariaDB Enterprise Tools introductionMariaDB plc
 
Faster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBFaster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBMariaDB plc
 
The architecture of SkySQL
The architecture of SkySQLThe architecture of SkySQL
The architecture of SkySQLMariaDB plc
 

More from MariaDB plc (20)

MariaDB Paris Workshop 2023 - MaxScale 23.02.x
MariaDB Paris Workshop 2023 - MaxScale 23.02.xMariaDB Paris Workshop 2023 - MaxScale 23.02.x
MariaDB Paris Workshop 2023 - MaxScale 23.02.x
 
MariaDB Paris Workshop 2023 - Newpharma
MariaDB Paris Workshop 2023 - NewpharmaMariaDB Paris Workshop 2023 - Newpharma
MariaDB Paris Workshop 2023 - Newpharma
 
MariaDB Paris Workshop 2023 - Cloud
MariaDB Paris Workshop 2023 - CloudMariaDB Paris Workshop 2023 - Cloud
MariaDB Paris Workshop 2023 - Cloud
 
MariaDB Paris Workshop 2023 - MariaDB Enterprise
MariaDB Paris Workshop 2023 - MariaDB EnterpriseMariaDB Paris Workshop 2023 - MariaDB Enterprise
MariaDB Paris Workshop 2023 - MariaDB Enterprise
 
MariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance OptimizationMariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance Optimization
 
MariaDB Paris Workshop 2023 - MaxScale
MariaDB Paris Workshop 2023 - MaxScale MariaDB Paris Workshop 2023 - MaxScale
MariaDB Paris Workshop 2023 - MaxScale
 
MariaDB Paris Workshop 2023 - novadys presentation
MariaDB Paris Workshop 2023 - novadys presentationMariaDB Paris Workshop 2023 - novadys presentation
MariaDB Paris Workshop 2023 - novadys presentation
 
MariaDB Paris Workshop 2023 - DARVA presentation
MariaDB Paris Workshop 2023 - DARVA presentationMariaDB Paris Workshop 2023 - DARVA presentation
MariaDB Paris Workshop 2023 - DARVA presentation
 
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 SkySQL Autonome Skalierung, Observability, Cloud-Backup
MariaDB SkySQL Autonome Skalierung, Observability, Cloud-BackupMariaDB SkySQL Autonome Skalierung, Observability, Cloud-Backup
MariaDB SkySQL Autonome Skalierung, Observability, Cloud-Backup
 
Einführung : MariaDB Tech und Business Update Hamburg 2023
Einführung : MariaDB Tech und Business Update Hamburg 2023Einführung : MariaDB Tech und Business Update Hamburg 2023
Einführung : MariaDB Tech und Business Update Hamburg 2023
 
Hochverfügbarkeitslösungen mit MariaDB
Hochverfügbarkeitslösungen mit MariaDBHochverfügbarkeitslösungen mit MariaDB
Hochverfügbarkeitslösungen mit MariaDB
 
Die Neuheiten in MariaDB Enterprise Server
Die Neuheiten in MariaDB Enterprise ServerDie Neuheiten in MariaDB Enterprise Server
Die Neuheiten in MariaDB Enterprise Server
 
Global Data Replication with Galera for Ansell Guardian®
Global Data Replication with Galera for Ansell Guardian®Global Data Replication with Galera for Ansell Guardian®
Global Data Replication with Galera for Ansell Guardian®
 
Introducing workload analysis
Introducing workload analysisIntroducing workload analysis
Introducing workload analysis
 
Under the hood: SkySQL monitoring
Under the hood: SkySQL monitoringUnder the hood: SkySQL monitoring
Under the hood: SkySQL monitoring
 
Introducing the R2DBC async Java connector
Introducing the R2DBC async Java connectorIntroducing the R2DBC async Java connector
Introducing the R2DBC async Java connector
 
MariaDB Enterprise Tools introduction
MariaDB Enterprise Tools introductionMariaDB Enterprise Tools introduction
MariaDB Enterprise Tools introduction
 
Faster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBFaster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDB
 
The architecture of SkySQL
The architecture of SkySQLThe architecture of SkySQL
The architecture of SkySQL
 

Recently uploaded

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 

Recently uploaded (20)

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 

MariaDB Server Performance Tuning & Optimization

  • 1. MariaDB Server performance tuning & optimization James McLaurin Solution Architect MariaDB
  • 2. Agenda MariaDB Performance Tuning: – Common Principles and Best Practices – Server Hardware and OS – MariaDB Configuration Settings – Database Monitoring – Query Tuning Blog: https://mariadb.com/resources/blog/20-tips-prepare-your-database-black-friday-cyber-monday
  • 3. Why Tune? The task of scalable server software is to maintain top performance for an increasing number of clients. ● Make efficient use of server resources ● Best performance for users ● Avoid outages due to server slowness ● Capacity ○ Be Prepared for Application Development Requirements ○ Allow for Unexpected Traffic Spikes or Other Changes in Demand
  • 4. Tune what? Initial recommended values for performance: ● transaction-isolation = READ-COMMITTED ● key_buffer – 128MB for every 1GB of RAM ● sort_buffer_size – 1MB for every 1GB of RAM ● read_buffer_size – 1MB for every 1GB of RAM ● read_rnd_buffer_size – 1MB for every 1GB of RAM ● thread_concurrency – is based on the number of CPUs so make it CPU*2 ● thread-handling=pool-of-threads ● innodb_flush_log_at_trx_commit != 1 – speed changes spectacularly if it’s !=1 ● open_files_limit = 50000
  • 5. Tune what? ● Configuring threadpool ○ Pool-of-threads, or threadpool, is a MariaDB feature that improves performance by pooling active threads together instead of the old one thread per client connection method, which does not scale well for typical web-based workloads with many short-running queries. ● Change innodb_flush_log_at_trx_commit to something !=1 ○ speed changes spectacularly if it is !=1 ● The more memory available … the better
  • 6. The “performance values” MariaDB performance parameters: ● InnoDB file-per-table ● InnoDB Buffer Pool Size ● Disable Swappiness In MariaDB ● Max Connections ● Thread Cache Size ● Disable MySQL DNS Lookups ● Query Cache Size ● Tmp Table Size & Max Heap Table Size ● Slow Query Logs ● Idle Connections
  • 8. Tuning Routine - When to Tune • Use Monitoring Tool - MonYog • Tune from Start of the Application Lifecycle – Start Early to Ensure Schema is Well Constructed – Test Queries on Real Data — Watch for Bottlenecks – Over Tuning without Production Data or Traffic is Counter Productive • Conduct Periodic Reviews of Production Systems – Watch for Schema, Query and Significant Changes – Check Carefully New Application Features – Monitor System Resources — Disk, Memory, Network, CPU
  • 9. my.cnf configuration file • Change one setting at a time... – This is the only way to determine if a change is beneficial. • Most settings can be changed at runtime with SET GLOBAL. – It is very handy and it allows you to quickly revert the change if needed. – To make the change permanent, you need to update the configuration file. • If a change in the configuration is not visible even after a MariaDB restart… – Did you use the correct configuration file? – Did you put the setting in the right section? •Normally the [mysqld] section for these settings
  • 10. my.cnf configuration file • The server refuses to start after a change: – Did you use the correct units? •For instance, innodb_buffer_pool_size should be set in bytes while max_connection is dimensionless. • Do not allow duplicate settings in the configuration file. – If you want to keep track of the changes, use version control. • Don’t do naive math, like “my new server has 2x RAM, it’ll just make all the values 2x the previous ones”.
  • 12. Server Hardware • One Service per Server is Ideal to Prevent Contention – Have the database server be only a database server etc. • More CPU Cores is generally Good • More Disk is usually Better – Large Datasets, Fast Disks are Ideal • More RAM is usually Best — Traffic Dependent – More of Dataset in Memory, Fewer Slow Disk Operations
  • 13. OS Settings Linux Settings •Swappiness ○ Value for propensity of the OS to swap to disk ○ Defaults are usually 60 ○ Commonly set low to 10 or so (not 0) •Noatime ○ Mount disks with this option ○ Turns off writing of access time to disk with every file access ○ Without this option every read becomes an additional write
  • 15. Configuration Settings innodb_buffer_pool_size •The first setting to update •The buffer pool is where data and indexes are cached • Utilize memory for read operations rather than disk •80% RAM rule of thumb •Typical values are ✓ 5-6GB (8GB RAM) ✓ 20-25GB (32GB RAM) ✓ 100-120GB (128GB RAM)
  • 16. Configuration Settings query_cache_size ● Query cache is a well known bottleneck ● Consider setting query_cache_size = 0 ● Use other ways to speed up read queries: ○ Good indexing ○ Adding replicas to spread the read load
  • 17. Configuration Settings innodb_log_file_size ● Size of the redo logs - 25 to 50% of innodb_buffer_pool usually recommended ● Redo logs are used to make sure writes are fast and durable and also during crash recovery ● Larger log files can lead to slower recovery in the event of a server crash ● But! Larger log files also reduce the number of checkpoints needed and reduce disk I/O
  • 18. Configuration Settings innodb_file_per_table ● Each .ibd file represents a tablespace of its own. ● Database operations such as “TRUNCATE” can be completed faster and you may also reclaim unused space when dropping or truncating a database table. ● Allows some of the database tables to be kept in separate storage device. This can greatly improve the I/O load on your disks.
  • 19. Configuration Settings Disable MySQL Reverse DNS Lookups ● MariaDB performs a DNS lookup of the user’s IP address and Hostname with connection ● The IP address is checked by resolving it to a host name. The hostname is then resolved to an IP to verify ● This allows DNS issues to cause delays ● You can disable and use IP addresses only ○ skip-name-resolve under [mysqld] in my.cnf
  • 20. Configuration Settings max_connections •‘Too many connections’ error? •Using a connection pool at the application level or a thread pool at the MariaDB level can help
  • 21. Configuration Settings Check for MySQL idle Connections ● Idle connections consume resources and should be interrupted or refreshed when possible. ● Idle connections are in “sleep” state and usually stay that way for long period of time. ● To look for idled connections: ● # mysqladmin processlist -u root -p | grep “Sleep” ● You can check the code for the cause if many idled ● You can also change the wait_timeout value
  • 22. Configuration Settings thread_cache_size ● The thread_cache_size directive sets the amount of threads that your server should cache. ● To find the thread cache hit rate, you can use the following technique: ○ show status like 'Threads_created'; ○ show status like 'Connections'; ● calculate the thread cache hit rate percentage: ○ 100 - ((Threads_created / Connections) * 100) ● Dynamically set to a new value: ○ set global thread_cache_size = 16;
  • 23. Configuration Settings memory parameters ● MariaDB uses temporary tables when processing complex queries involving joins and sorting ● The default size of a temporary table is very small ○ The size is configured in your my.cnf: tmp-table-size = 1G max-heap-table-size = 1G ● Both should have the same size and will help prevent disk writes ● A rule of thumb is giving 64Mb for every GB of RAM on the server
  • 24. Configuration Settings Buffer Sizes ● join buffer size ○ used to process joins – but only full joins on which no keys are possible ● sort buffer size ○ Sort buffer size is used to sort data. ○ The system status variable sort_merge_passes will indicates need to increase ○ This variable should be as low as possible. ● These buffers are allocated per connection and play a significant role in the performance of the system.
  • 25. Configuration Settings max_allowed_packet ● MariaDB splits data into packets. Usually a single packet is considered a row that is sent to a client. ● The max_allowed_packet directive defines the maximum size of packet that can be sent. ● Setting this value too low can cause a query to stall and you will receive an error in your error log. ● It is recommended to set the value to the size of your largest packet. ○ Some suggest 11 times the largest BLOB
  • 27. System Metrics Metric Comments Suggested Alert Load An all-in-one performance metric. When load is > factor x (number of cores). Our suggested factor is 4. CPU usage A high CPU usage is not a bad thing as long as you don’t reach the limit. None Memory usage Ideally your entire database should be stored in memory, but this is not always possible. Give MySQL as much as you can afford but leave enough for other processes to function. None Swap usage Swap is for emergencies only, and it should not be used. When used swap is > 128MB. Network bandwidth Unless doing backups or transferring huge amounts of data, it shouldn’t be the bottleneck. None Disk usage Make sure you always have free space for new data, temporary files, snapshot or backups. When database, logs and temp is > 85% usage.
  • 28. Disk Monitoring Metric Comments Suggested Alert Read/Write requests IOPS (Input/Output operations per second) None IO Queue length Tracks how many operations are waiting for disk access. If a query hits the cache, it doesn’t create any disk operation. If a query doesn’t hit the cache (i.e. a miss), it will create multiple disk operations. None Average IO wait Time that queue operations have to wait for disk access. None Average Read/Write time Time it takes to finish disk access operations (latency). None Read/Write bandwidth Data transfer from and towards your disk. None
  • 29. MariaDB Metrics Metric Comments Suggested Alert Uptime Seconds since the server was started. We can use this to detect respawns. When uptime is < 180. Threads_connected Number of clients currently connected. If none or too high, something is wrong. None Max_used_connections Max number of connections at a time since server started. (max_used_connections / max_connections) indicates if you could run out soon of connection slots. When connections usage is > 85%. Aborted_connects Number of failed connection attempts. When growing over a period of time either some credentials are wrong or we are being attacked. When aborted connects/min > 3. (only on not public exposed servers, otherwise will generate noise)
  • 30. MariaDB typical errors common failure points to keep an eye on Metric Comments Suggested Alert (Errors) Are there any errors on the mysql.log file? None (Log files size) Are all log files being rotated? None (Deleted log files) Were any log files deleted but the file descriptor is still open? None (Backup space) Do you have enough disk space for backups? None
  • 31. Monitoring caches, buffers & locks Metric Comments Suggested Alert Innodb_row_lock_waits Number of times InnoDB had to wait before locking a row. None Innodb_buffer_pool_wait_free Number of times InnoDB had to wait for memory pages to be flushed. If too high, innodb_buffer_pool_size is too small for current write load. None Open_tables Number of tables currently open. If this is low and table_cache is high, we can reduce cache size. If opposite, we should increase it. If you increase table_cache you might have to increase available file descriptors for the mysql user. None (Long running transactions) Tracks whether too many transactions are locked by other idle transactions, or because of a problem in InnoDB. None (Deadlocks) Deadlocks happen when 2 transactions mutually hold. These are unavoidable in InnoDB and apps should deal with them. None
  • 32. Monitoring Queries Metric Comments Suggested Alert Slow_queries Number of queries that took more than long_query_time seconds to execute. Slow queries generate excessive disk reads, memory and CPU usage. Check slow_query_log to find them. None Select_full_join Number of full joins needed to answer queries. If too high, improve your indexing or database schema. None Created_tmp_disk_tables Number of temporary tables (typically for joins) stored on slow spinning disks, instead of faster RAM. None (Full table scans) Handler_read% Number of times the system reads the first row of a table index. Sequential reads might indicate a faulty index. None
  • 34. Query Tuning Enable Slow query Logs Logging slow queries can help you determine issues with your database and help you debug them. This can be easily enabled by adding the following values in your my.cnf configuration file: slow-query-log = 1 slow-query-log-file = /var/lib/mysql/mysql-slow.log long_query_time = 1 The first directive enables the logging of slow queries, while the second one tells MariaDB where to store the actual log file. Use long_query_time to define the amount of time that is considered long for a MariaDB query to be completed.
  • 35. EXPLAIN SELECT * FROM employees WHERE MONTH(birth_date) = 8 G id: 1 select_type: SIMPLE table: employees type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 299587 Extra: Using where Query Tuning Query Analysis ● Use the Slow Log to find Problem Queries ● Use mysqldumpslow Utility for Manageable Reports ● Use EXPLAIN to see how MariaDB Executes a Troublesome Query and if Indexes are Used ● Use EXPLAIN EXTENDED and SHOW WARNINGS to see how MariaDB Rearranges a Query before Execution EXPLAIN SELECT * FROM employees WHERE MONTH(birth_date) = 8 G id: 1 select_type: SIMPLE table: employees type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 299587 Extra: Using where
  • 36. EXPLAIN SELECT * FROM employees WHERE MONTH(birth_date) = 8 G id: 1 select_type: SIMPLE table: employees type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 299587 Extra: Using where Query Tuning Query Tuning Overview ● Try Not to Query Tune on Production Server ● Use Test Server with same Hardware and OS ● Use Copy of Production Data Set ● Query Frequency is as Important as Query Speed ○ Moderately Slow Queries are often a Bigger Problem than a Rarely Run Very Slow Query
  • 37. EXPLAIN SELECT * FROM employees WHERE MONTH(birth_date) = 8 G id: 1 select_type: SIMPLE table: employees type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 299587 Extra: Using where Query Tuning Indexing ● Indexes Improve Read Performance ● Without Index, MariaDB Must Read Every Row — Full Table Scan ● With Index, MariaDB can jump to Requested Rows ● Reduced I/O and Improving Performance ● Index Increase cost of Writes ● Find Balance ● Index for Speed, but Avoid Indexing Excessively or Arbitrarily ● Remove Dead or Redundant Indexes
  • 38. EXPLAIN SELECT * FROM employees WHERE MONTH(birth_date) = 8 G id: 1 select_type: SIMPLE table: employees type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 299587 Extra: Using where Query Tuning Index Size ● Keep Indexes as Small as Practical ○ Faster since More Likely to Fit in Memory ○ Rebuilds Faster after Writes ○ PRIMARY KEY should be Minimum Useful Size ● Use Partial Prefix Indexes for String Columns ○ May Slow Searches Slightly, but Reduce Index Size ● Use Index Cardinality (Uniqueness Measure) Only If Necessary — Re-evaluate as Data Grows ○ Low Cardinality Indicates many Duplicates ○ High Cardinality is More Useful
  • 39. EXPLAIN SELECT * FROM employees WHERE MONTH(birth_date) = 8 G id: 1 select_type: SIMPLE table: employees type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 299587 Extra: Using where Query Tuning Tools & Statistics ● Identify Accurately and Carefully Trouble Spots ○ Guessing is Rarely Useful ● Gather Performance Stats with MariaDB and OS Tools ○ SHOW Statements ○ PERFORMANCE_SCHEMA ○ CPU, Disk, Network, Memory, & Swap Stats ● Retain Snapshots of Multiple Stats ○ Data from a Single Point Shows very Little ● Automate the Collection of Stats into Logs ○ Can be Useful for Emergency Tuning
  • 40. EXPLAIN SELECT * FROM employees WHERE MONTH(birth_date) = 8 G id: 1 select_type: SIMPLE table: employees type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 299587 Extra: Using where Query Tuning SHOW PROCESSLIST ● Snapshot of mysqld Activity ● mysqld is Multi-Threaded, One Thread per ○ Client Connection (i.e., query, transaction) — a "process" is a "thread" ● Accumulate SHOW PROCESSLIST Snapshots to build History of Thread Activities
  • 41. EXPLAIN SELECT * FROM employees WHERE MONTH(birth_date) = 8 G id: 1 select_type: SIMPLE table: employees type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 299587 Extra: Using where Query Tuning SHOW STATUS Global or Session ● Returns List of Internal Counters ● GLOBAL for System-Wide Status — Since Start-Up ● SESSION for Local to Client Connection ● FLUSH STATUS Resets Local Counters ● Monitor Changes to Counters to Identify Hot Spots ● Collect Periodically Status Snapshots to Profile Traffic
  • 42. EXPLAIN SELECT * FROM employees WHERE MONTH(birth_date) = 8 G id: 1 select_type: SIMPLE table: employees type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 299587 Extra: Using where Query Tuning PERFORMANCE_SCHEMA ● Similar to INFORMATION_SCHEMA , but Performance Tuning ● Monitors MariaDB Server Events ● Function Calls, Operating System Waits, Internal Mutexes, I/O Calls ● Detailed Query Execution Stages (Parsing, Statistics, Sorting) ● Some Features Storage Engine Specific ● Monitoring Lightweight and Requires No Dedicated Thread ● Designed to be Used Iteratively with Successive Refinement