SlideShare a Scribd company logo
1 of 51
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1
MySQL Performance Tuning
MySQL Global Business Unit
Sales Consulting Senior Manager, JAPAC
梶山 隆輔 / Ryusuke Kajiyama
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
MAKE MySQL
a Better MySQL
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.3
MySQL 5.5
MySQL Cluster 7.3
MySQL Enterprise Monitor 2.3
MySQL Enterprise Backup
Security
Scalability
HA
Audit
MySQL 5.6
MySQL Workbench 6.0
MySQL Utilities
MySQL Applier for
Hadoop
MySQL Workbench 5.2
MySQL Enterprise Oracle
Certifications
Over 3,5 Years of MySQL Innovation
MySQL Cluster Manager
Windows installer & Tools
MySQL Cluster 7.2
MySQL Cluster 7.1
MySQL Migration
Wizard
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4
MySQL: Everywhere and Growing
Platform of Choice for Next Generation Web, Cloud & Embedded Applications
World’s Most
Popular Open
Source
Database
Database
Platform for
Next Gen
Web Apps
Leading
Database for
Web
Applications
Leading
Database in
the Cloud
Integrated with
Hadoop in
majority of Big
Data platforms
#1 Linux Career IT
skill: MySQL *
* Source: Linux Career IT Skills Watch update July 2013
Downloads & Sales
Growth
Best of both Worlds
SQL+NoSQL
LAMP + Python
+Node.js + Go +...
Awards & Social
Media Momentum
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.5
MySQL 5.6: Best Release Ever!
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6
MySQL 5.6: Scalability
 Users can fully utilize latest generations of hardware and OS
 Scales as data volumes and users grow
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.7
MySQL 5.5
MySQL 5.6
MySQL 5.6 SysBench Benchmarks
Up to 234% Performance Gain
Replication Binary Log Group Commit
• Days of losing 50%+
master performance
are gone!
• 10% overhead when
configuring
sync_binlog=0
• Additional 5% when
configuring
sync_binlog=1
https://blogs.oracle.com/MySQL/entry/mysql_5_6_replication_performance
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9
Same app can leverage:
 Key-value access to InnoDB via
familiar Memcached API
 SQL for rich queries, JOINs,
FKs, etc.
 Fully transactional
MySQL 5.6: InnoDB
NoSQL Key Value Access to InnoDB
 Up to 9x performance boost for
updates
 Great for fast data ingestion in Big
Data pipeline
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10
MySQL 5.6: Optimizer
• Simple word but many meanings
• Main objective:
• Users (direct or indirect) should be satisfied
• Most typical performance metrics
• Throughput
• Latency / Response time
• Scalability
• Combined metrics
Starvation
transactions/time
Defining Performance
• Multi User applications
• Request waits in queue before being processed
• User response time = queueing delay + service time
• Non high tech example – support call center.
• “Hockey Stick” - queuing delay grows rapidly when
system getting close to saturation
• Need to improve queueing delay or service time
to improve performance
• Improving service time reduces queuing delay
Connections
ResponseTime
Queuing Theory
• Main Question – where does service time comes from ?
• network, cpu, disk, locks...
• Direct Measurements
• Sum up all query times from web pages
• Indirect measurements
• CPU usage
• Disk IO latency
• Network traffic
• Load Average
• Number of running queries
• etc.
Service Time: Key to the hotspot
Benchmark Tests
• Great tool to:
• Quantify application performance
• Measure performance effect of the changes
• Validate Scalability
• Plan deployment
• But
• Can be very misleading if done wrong
• Need to be able to read results correctly
• Typical Errors
• Testing with 1GB size with 100G in production
• Using uniform distribution
• “Harry Potter” ordered as frequent as Zulu dictionary
• Testing in single user scenario
Benchmark Tools for MySQL
• Creating own benchmark tool
– Generating from SQL statements in General Log
– Fetching SQL statements with MySQL Proxy or TCP Dump
• DBT2
– http://osdldbt.sourceforge.net/
– http://nippondanji.blogspot.com/2009/03/dbt-2.html
• mysqlslap MySQL 5.1 +
– http://dev.mysql.com/doc/refman/5.6/en/mysqlslap.html
• SysBench
– http://sysbench.sourceforge.net/
• Performance costs money, whatever road you take
• Investigate different possibilities
• Better hardware could be cheaper than a major rewrite
• How much performance/scalability/reliability do you need ?
• 99.999% could be a lot more expensive than 99.9%
• Is peak traffic requirements 100x average or just 3x ?
• Take a look at whole picture
• Is this the largest risk/bottleneck ?
• Identify which optimizations are critical for business
• Optimization of “everything” is often waste of resources
• What is the cost of suboptimal performance ?
Business side of optimization
Basic1: Checking Server Configurations
• The MySQL server is controlled by “System Variables”
• Set via:
• Option File:   my.cnf / my.ini
• Temporary change: SET [GLOBAL] <vriable>=<value>
• Can be per connection (LOCAL) or server wide(GLOBAL)
Basic2: Checking Status of Server
 Monitor system performance using “Status Variables”
• Knowing internal commands of one query
Mysql> FLUSH STATUS; <run query>; SHOW STATUS;
• Checking status periodically
shell> mysqladmin -u -p ... ex -i 15 -r | grep -v ‘ 0 ‘
http://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html
Client2 ClientN
Connection Thread Pool
Parser Query 101101
Client1
Optimizer
Storage Engines
 InnoDB
 MyISAM
 MERGE
 MEMORY
 ARCHIVE
Query Cache
MySQL Server
MySQL Server Architecture
• max_connections (151)
• number of connections server will
allow. May run out of memory if too
high, because of per connections
memory usage
• thread_cache_size (8)
• Keep up to this amount of threads
“cached” after disconnect
• Typical setting
max_connections/3
Client2 ClientN
Connection Thread Pool
Client1
mysql> show status;
• Max_used_connections
• check if it matches
max_connections, too low value or
sign of overload
• Threads_created
• thread_cache misses
• should be low.
Server Connections & Threads
• sort_buffer_size (2M)
• Memory to allocate for sort. Will use
disk based sort for larger data sets.
Often fine at 512K or 1M
• other buffers, read,
read_rnd, etc… smaller
defaults often OK
• You can change dynamically if
large sort operation is needed
in batch operation etc
Client2 ClientN
Connection Thread Pool
Client1
mysql> show status;
• Sort_merge_passes -
• number of passes made
during file merge sort.
• check if file sort needs to be
done at all
• use index if possible
Connection Thread Work Buffers
• query_cache_size (0)
• Amount of memory to use for query
cache
• Typically 32M is fine, some
databases need 128M
• query_cache_type (ON)
• Worst case performance overhead
is about 15%-20%
• Favors servers with higher
SELECT/WRITE ratios
• Best Practice
• Set to DEMAND
• Add SQL_CACHE to appropriate
queries
Connection Thread Pool
Parser Query 101101
Query Cache
mysql> show status;
• Qcache_hits, Qcache_inserts
• hits/inserts cache hit ratio, if small, maybe
disable query cache
• Qcache_lowmem_prunes
• times older queries were removed due to
low memory, need to increase
query_cache_size if high
Server Query Cache
• innodb_buffer_pool_size
• 80% of memory on Innodb only system
• caches data & indexes unlike MyISAM
• innodb_log_file_size
• A key parameter for write performance
• Recovery time is no more an issue.
• Bigger is better for write QPS stability
• innodb_flush_log_at_trx_commit
• 1 (slow) will flush (fsync) log at each commit. Truly
ACID
• 2 (fast) will only flush log buffer to OS cache on
commit, sync to disk once/sec.
• 0 (fastest) will flush (fsync) log every second or so
• innodb_file_per_table
• Always good choice to distribute i/o
• Default ON from 5.6
Storage Engines
 InnoDB
 MyISAM
 MERGE
 MEMORY
ARCHIVE
mysql> SHOW ENGINE
INNODB STATUS;
Great way to see what is
going on inside InnoDB,
hard to parse
• File IO
• Buffer Pool
• Log activity
• Row activity
InnoDB Performance Tips
• innodb_flush_method = O_DIRECT
• Not to consume OS cache
• innodb_buffer_pool_instances (5.5+)
• To avoid mutex contention
• 2 or more in can
• innodb_io_capacity (5.5+)
• Enlarge if you have fast disks
• Default 200 is good for 2 disks striped
• innodb_read_io_threads (5.5+)
• innodb_write_io_threads (5.5+)
• Enlarge if you have fast disks
• Default 4 is usually good enough
Storage Engines
 InnoDB
 MyISAM
 MERGE
 MEMORY
ARCHIVE
mysql> SHOW ENGINE
INNODB STATUS;
Great way to see what is
going on inside InnoDB,
hard to parse
• File IO
• Buffer Pool
• Log activity
• Row activity
InnoDB Performance Tips (Cont.)
DBT-2 (W200) Transactions per Minute %user %iowait
Buffer pool 1G 1125.44 2% 30%
Buffer pool 2G 1863.19 3% 28%
Buffer pool 5G 4385.18 5.5% 33%
Buffer pool 30G
(All data in cache) 36784.76 36% 8%
Semi-in-memory Database with InnoDB
• DBT-2 benchmark (write intensive)
• 20-25GB hot data (200 warehouses, running 1 hour)
• Nehalem 2.93GHz x 8 cores, MySQL 5.5.2, 4 RAID1+0 HDDs
• RAM size affects everything. Not only for SELECT,
but also for INSERT/UPDATE/DELETE
• INSERT: Random reads/writes happen when inserting into indexes in random order
• UPDATE/DELETE: Random reads/writes happen when modifying records
• Normalization
• good for OLTP, writes
• data redundancies eliminated
• join performance penalty
• smaller total data set
• E/R diagram clean translation
• Denormalization
• good for OLAP, reporting
• data redundancies across tables
for better indexing
• maybe eliminate joins
• Data types
– use tinyint, smallint, mediumint,
save space!
– join columns same data type
– varchar(64) instead of char(64)
– declare NOT NULL if true
– varchar(64) instead of varchar(255)
– INT not DECIMAL(9)
• Indexing
– multi-column
– ordered BTREE
– index prefixes
– covering
Schema Design
#Time: 08073101 16:25:24
#User@Host: root[root] @ localhost [127.0.0.1]
#Query_time: 8 Lock_time: 0 Rows_sent: 20 Rows_examined: 243661
SELECT part_num FROM `inventory`.`parts` WHERE
(`ven` = "foo") ORDER BY `delivery_datetime` DESC LIMIT 100;
Monitoring Queries - Slow Query Log
Cons
• Requires MySQL restart (5.0 and lower)
• Growth must be managed using FLUSH LOGS
• Entries must be parsed/sorted for relevance
• mysqldumpslow helps, but still tedious, takes time
Pros
• Logs queries that took longer than X (user defined)
• Logs queries that do not use indexes (5.0 and higher)
• Includes data needed to trace offending queries
Monitoring Queries – SHOW PROCESSLIST;
mysql> SHOW FULL PROCESSLISTG
******** 1. row *****************
Id: 1
User: MyUser
Host: localhost
db: inventory
Command: Query
Time: 1030455
State: Sending Data
Info: SELECT part_num from ‘inv’;
…..
2 rows in set (0.00 sec)
Pros
• Shows current processes
• Shows status of executing
queries
• Includes data needed to trace
offending queries
Con
Scripting needed to:
• automate,
• integrate with Slow Query Log,
• Aggregate/parse results for
analysis,
• notify DBA of problem
Fixing Problem Queries – EXPLAIN;
EXPLAIN SELECT part_num
FROM `inventory`.`parts`
WHERE (`ven` = "foo")
ORDER BY `delivery_datetime`
DESC LIMIT 100;G
******** 1. row *************
ID: 1
select_type: SIMPLE
table: parts
type: ref
possible_keys: ven, part#
key: ven
key_len: 3
ref: null
rows: 872
Extra: Using WHERE
1 row in set (0.00 sec)
Analyze
• How indexes are being used (or
not…)
• required filesorts
• What tables, columns are being
queried
Fix/Tune - involves iterations of:
• Add/alter indexes
• Alter tables, columns, datatypes
• Alter query structure
• Test, 10 GOTO 10 until done
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1230
MySQL Enterprise Monitor
 Real-time MySQL performance and availability monitoring
 Visually find & fix problem queries
 Disk monitoring for capacity planning
 Cloud friendly architecture (no agents)
 Start monitoring MySQL in 10 minutes
 Remote agent option provides OS monitoring
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1231
MySQL Query Analyzer
 Real-time query performance
 Visual correlation graphs
 Find & fix expensive queries
 Detailed query statistics
 Query Response Time index (QRTi)
“With the MySQL Query Analyzer, we were able to
identify and analyze problematic SQL code, and triple
our database performance. More importantly, we were
able to accomplish this in three days, rather than
taking weeks.”
Keith Souhrada
Software Development Engineer
Big Fish Games
MySQL Enterprise Scalability
MySQL Thread Pool
• MySQL default thread-handling – excellent
performance, can limit scalability as connections grow
• MySQL Thread Pool improves sustained
performance/scale as user connections grow
• Thread Pool API
New!
MySQL Enterprise Scalability
Configuration
MySQL 5.6.11
Oracle Linux 6.3, Unbreakable Kernel 2.6.32
4 sockets, 24 cores, 48 Threads
Intel(R) Xeon® E7540 2GHz CPUs
512GB DDR RAM
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.34
Performance Schema in MySQL 5.5 & MySQL 5.6
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.35
Performance Schema in MySQL 5.5
Laid out the framework for instrumentation
Focused early on low level instruments
– Prove it could handle load, build from ground up
Not turned on by default, had some overhead issues
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.36
Performance Schema in MySQL 5.5
17 Tables
222 Instruments
Instrument Event Class
File IO wait/io/file/%
Mutexes wait/synch/mutex/%
Read/Write
Locks
wait/synch/rwlock/%
Conditions wait/synch/cond/%
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.37
Performance Schema in MySQL 5.5
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.38
Performance Schema in MySQL 5.6
Fixed lots of performance issues
Focused on bringing the instrumentation to the DBA / Developer
Statements / Statement Digests
Execution Stages
Object tracking (table / index IO, table locks)
Network IO
Turned on by default, with a subset of instrumentation disabled
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.39
Performance Schema in MySQL 5.6
52 Tables (+35)
545 Instruments (+323)
Instrument
Type
Event Class
Statements statement/%
Stages stage/%
Table IO wait/io/table/%
Table Locks wait/lock/table/%
Network IO wait/io/socket/%
Idle Timing idle
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.40
Performance Schema in MySQL 5.6
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.41
Improvements made to date in MySQL 5.7
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12
Insert Picture Here
42
Memory Usage
Metadata Locking
Replication Configuration & Status
Prepared Statements
Transactions
Stored Programs
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.43
Improvements made to date in MySQL 5.7
75 Tables (+23)
784 Instruments (+239)
Instrument Type Event Class
Transactions transaction
Memory memory/%
Metadata Locks wait/lock/metadata/%
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.44
Improvements made to date in MySQL 5.7
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.45
DMRs: Development Milestone Releases
 Fully Functional Release Candidate Quality
 Two to Four per Year
 Early Community Testing, Use, & Feedback
 Accelerates Rate of Enhancements
 Improves Quality
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.46
MySQL 5.7
 InnoDB for better transactional throughput, availability
 Replication for better scalability and availability
 Utilities for dev/ops automation
 Performance Schema for better performance metrics
 Optimizer for better EXPLAINing query performance
Available Now! Get it here:
MySQL 5.7.2 builds on MySQL 5.6 by improving:
dev.mysql.com/downloads/mysql/
New!
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.47
MySQL 5.7 Sysbench Benchmarks
Sysbench Point Select
Intel(R) Xeon(R) CPU X7560 x86_64
4 sockets x 8 cores-HT (64 CPU threads)
2.27GHz, 256G RAM
Oracle Linux 6.2
95% Faster than MySQL 5.6
172% Faster than MySQL 5.5
500,000 QPS
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.48
RO In-Memory @MySQL 5.7
 Sysbench OLTP_RO 8-tables, 32cores-HT :
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.49
RO In-Memory @MySQL 5.7
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.50
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.51
第一次台灣 MySQL 社群聚會
 我們將在 7 月 22 日下午 6:00 到 8:00 借用台北市忠孝西路
一段 35 樓甲骨文的會議室,舉辦第一次台灣 MySQL 社群
聚會,歡迎您抽空參加。在聚會中我們將會中提供簡單的晚
餐,同時分享 MySQL 的最新動態,包括:
– 展示如何用新發表的 MySQL Fabric 支持上 PB 級資料的應用系統,
做資料庫分表分庫,高可用和讀寫分離
– MySQL 5.7.4 DMR 的新功能和産品發展路線
 也非常歡迎您分享您的心得和意見如果您打算參加 22 日的
聚會,或打算分享您的心得
1st
TWMUG meeting

More Related Content

What's hot

MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMorgan Tocker
 
MySQL Performance Tuning Variables
MySQL Performance Tuning VariablesMySQL Performance Tuning Variables
MySQL Performance Tuning VariablesFromDual GmbH
 
Mysql 57-upcoming-changes
Mysql 57-upcoming-changesMysql 57-upcoming-changes
Mysql 57-upcoming-changesMorgan Tocker
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBMydbops
 
MySQL Manchester TT - Performance Tuning
MySQL Manchester TT  - Performance TuningMySQL Manchester TT  - Performance Tuning
MySQL Manchester TT - Performance TuningMark Swarbrick
 
MySQL Performance Tuning - GNUnify 2010
MySQL Performance Tuning - GNUnify 2010MySQL Performance Tuning - GNUnify 2010
MySQL Performance Tuning - GNUnify 2010OSSCube
 
Performance Tuning Best Practices
Performance Tuning Best PracticesPerformance Tuning Best Practices
Performance Tuning Best Practiceswebhostingguy
 
MySQL Server Defaults
MySQL Server DefaultsMySQL Server Defaults
MySQL Server DefaultsMorgan Tocker
 
Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Mydbops
 
Optimizing MySQL for Cascade Server
Optimizing MySQL for Cascade ServerOptimizing MySQL for Cascade Server
Optimizing MySQL for Cascade Serverhannonhill
 
Using MySQL in Automated Testing
Using MySQL in Automated TestingUsing MySQL in Automated Testing
Using MySQL in Automated TestingMorgan Tocker
 
Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree
Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree
Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree Ashnikbiz
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability Mydbops
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?Mydbops
 
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Morgan Tocker
 
Conquering "big data": An introduction to shard query
Conquering "big data": An introduction to shard queryConquering "big data": An introduction to shard query
Conquering "big data": An introduction to shard queryJustin Swanhart
 

What's hot (20)

MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
 
MySQL Performance Tuning Variables
MySQL Performance Tuning VariablesMySQL Performance Tuning Variables
MySQL Performance Tuning Variables
 
Mysql 57-upcoming-changes
Mysql 57-upcoming-changesMysql 57-upcoming-changes
Mysql 57-upcoming-changes
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
 
MySQL Manchester TT - Performance Tuning
MySQL Manchester TT  - Performance TuningMySQL Manchester TT  - Performance Tuning
MySQL Manchester TT - Performance Tuning
 
MySQL Performance Tuning - GNUnify 2010
MySQL Performance Tuning - GNUnify 2010MySQL Performance Tuning - GNUnify 2010
MySQL Performance Tuning - GNUnify 2010
 
Performance Tuning Best Practices
Performance Tuning Best PracticesPerformance Tuning Best Practices
Performance Tuning Best Practices
 
MySQL NoSQL APIs
MySQL NoSQL APIsMySQL NoSQL APIs
MySQL NoSQL APIs
 
MySQL Server Defaults
MySQL Server DefaultsMySQL Server Defaults
MySQL Server Defaults
 
Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.
 
Optimizing MySQL for Cascade Server
Optimizing MySQL for Cascade ServerOptimizing MySQL for Cascade Server
Optimizing MySQL for Cascade Server
 
MySQL Tuning
MySQL TuningMySQL Tuning
MySQL Tuning
 
Using MySQL in Automated Testing
Using MySQL in Automated TestingUsing MySQL in Automated Testing
Using MySQL in Automated Testing
 
Really Big Elephants: PostgreSQL DW
Really Big Elephants: PostgreSQL DWReally Big Elephants: PostgreSQL DW
Really Big Elephants: PostgreSQL DW
 
Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree
Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree
Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?
 
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7
 
Perf Tuning Short
Perf Tuning ShortPerf Tuning Short
Perf Tuning Short
 
Conquering "big data": An introduction to shard query
Conquering "big data": An introduction to shard queryConquering "big data": An introduction to shard query
Conquering "big data": An introduction to shard query
 

Similar to MySQL Performance Tuning at COSCUP 2014

MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015Mario Beck
 
VMworld 2013: Virtualizing Databases: Doing IT Right
VMworld 2013: Virtualizing Databases: Doing IT Right VMworld 2013: Virtualizing Databases: Doing IT Right
VMworld 2013: Virtualizing Databases: Doing IT Right VMworld
 
What's New in MySQL 5.7
What's New in MySQL 5.7What's New in MySQL 5.7
What's New in MySQL 5.7Olivier DASINI
 
제3회난공불락 오픈소스 인프라세미나 - MySQL Performance
제3회난공불락 오픈소스 인프라세미나 - MySQL Performance제3회난공불락 오픈소스 인프라세미나 - MySQL Performance
제3회난공불락 오픈소스 인프라세미나 - MySQL PerformanceTommy Lee
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive WritesLiran Zelkha
 
Got Problems? Let's Do a Health Check
Got Problems? Let's Do a Health CheckGot Problems? Let's Do a Health Check
Got Problems? Let's Do a Health CheckLuis Guirigay
 
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015 2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015 Geir Høydalsvik
 
MySQL :What's New #GIDS16
MySQL :What's New #GIDS16MySQL :What's New #GIDS16
MySQL :What's New #GIDS16Sanjay Manwani
 
VMworld Europe 2014: Virtualizing Databases Doing IT Right – The Sequel
VMworld Europe 2014: Virtualizing Databases Doing IT Right – The SequelVMworld Europe 2014: Virtualizing Databases Doing IT Right – The Sequel
VMworld Europe 2014: Virtualizing Databases Doing IT Right – The SequelVMworld
 
Deep Dive on MySQL Databases on AWS - AWS Online Tech Talks
Deep Dive on MySQL Databases on AWS - AWS Online Tech TalksDeep Dive on MySQL Databases on AWS - AWS Online Tech Talks
Deep Dive on MySQL Databases on AWS - AWS Online Tech TalksAmazon Web Services
 
MySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & TuneMySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & TuneMark Swarbrick
 
High Performance Mysql
High Performance MysqlHigh Performance Mysql
High Performance Mysqlliufabin 66688
 
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
 
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
 
Postgresql in Education
Postgresql in EducationPostgresql in Education
Postgresql in Educationdostatni
 
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15Dave Stokes
 
My sql 56_roadmap_april2012
My sql 56_roadmap_april2012My sql 56_roadmap_april2012
My sql 56_roadmap_april2012sqlhjalp
 

Similar to MySQL Performance Tuning at COSCUP 2014 (20)

MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015
 
MySQL 5.7 what's new
MySQL 5.7 what's newMySQL 5.7 what's new
MySQL 5.7 what's new
 
VMworld 2013: Virtualizing Databases: Doing IT Right
VMworld 2013: Virtualizing Databases: Doing IT Right VMworld 2013: Virtualizing Databases: Doing IT Right
VMworld 2013: Virtualizing Databases: Doing IT Right
 
What's New in MySQL 5.7
What's New in MySQL 5.7What's New in MySQL 5.7
What's New in MySQL 5.7
 
제3회난공불락 오픈소스 인프라세미나 - MySQL Performance
제3회난공불락 오픈소스 인프라세미나 - MySQL Performance제3회난공불락 오픈소스 인프라세미나 - MySQL Performance
제3회난공불락 오픈소스 인프라세미나 - MySQL Performance
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive Writes
 
Got Problems? Let's Do a Health Check
Got Problems? Let's Do a Health CheckGot Problems? Let's Do a Health Check
Got Problems? Let's Do a Health Check
 
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015 2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
 
MySQL :What's New #GIDS16
MySQL :What's New #GIDS16MySQL :What's New #GIDS16
MySQL :What's New #GIDS16
 
VMworld Europe 2014: Virtualizing Databases Doing IT Right – The Sequel
VMworld Europe 2014: Virtualizing Databases Doing IT Right – The SequelVMworld Europe 2014: Virtualizing Databases Doing IT Right – The Sequel
VMworld Europe 2014: Virtualizing Databases Doing IT Right – The Sequel
 
Deep Dive on MySQL Databases on AWS - AWS Online Tech Talks
Deep Dive on MySQL Databases on AWS - AWS Online Tech TalksDeep Dive on MySQL Databases on AWS - AWS Online Tech Talks
Deep Dive on MySQL Databases on AWS - AWS Online Tech Talks
 
MySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & TuneMySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & Tune
 
High Performance Mysql
High Performance MysqlHigh Performance Mysql
High Performance Mysql
 
Running MySQL on Linux
Running MySQL on LinuxRunning MySQL on Linux
Running MySQL on Linux
 
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
 
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
 
Postgresql in Education
Postgresql in EducationPostgresql in Education
Postgresql in Education
 
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
 
My sql 56_roadmap_april2012
My sql 56_roadmap_april2012My sql 56_roadmap_april2012
My sql 56_roadmap_april2012
 

More from Ryusuke Kajiyama

[OSC 2020 Online/Nagoya] MySQLドキュメントストア
[OSC 2020 Online/Nagoya] MySQLドキュメントストア[OSC 2020 Online/Nagoya] MySQLドキュメントストア
[OSC 2020 Online/Nagoya] MySQLドキュメントストアRyusuke Kajiyama
 
[OSC 2020 Osaka] MySQL"超"入門
[OSC 2020 Osaka] MySQL"超"入門[OSC 2020 Osaka] MySQL"超"入門
[OSC 2020 Osaka] MySQL"超"入門Ryusuke Kajiyama
 
[中国地方DB勉強会] 第22回 Webアプリ開発をデータベース側から変革していく - MySQL 8.0新機能
[中国地方DB勉強会] 第22回 Webアプリ開発をデータベース側から変革していく - MySQL 8.0新機能[中国地方DB勉強会] 第22回 Webアプリ開発をデータベース側から変革していく - MySQL 8.0新機能
[中国地方DB勉強会] 第22回 Webアプリ開発をデータベース側から変革していく - MySQL 8.0新機能Ryusuke Kajiyama
 
[OSC 2017 Tokyo/Fall] OSSコンソーシアム DB部会 MySQL 8.0
[OSC 2017 Tokyo/Fall] OSSコンソーシアム DB部会 MySQL 8.0[OSC 2017 Tokyo/Fall] OSSコンソーシアム DB部会 MySQL 8.0
[OSC 2017 Tokyo/Fall] OSSコンソーシアム DB部会 MySQL 8.0Ryusuke Kajiyama
 
[db tech showcase 2017 Tokyo] D31 - MySQL 8.0の日本語キャラクタ・セットと文字照合
[db tech showcase 2017 Tokyo] D31 - MySQL 8.0の日本語キャラクタ・セットと文字照合[db tech showcase 2017 Tokyo] D31 - MySQL 8.0の日本語キャラクタ・セットと文字照合
[db tech showcase 2017 Tokyo] D31 - MySQL 8.0の日本語キャラクタ・セットと文字照合Ryusuke Kajiyama
 
[db tech showcase 2017 Tokyo] A23 - MySQLのセキュリティ関連機能の現状
[db tech showcase 2017 Tokyo] A23 - MySQLのセキュリティ関連機能の現状[db tech showcase 2017 Tokyo] A23 - MySQLのセキュリティ関連機能の現状
[db tech showcase 2017 Tokyo] A23 - MySQLのセキュリティ関連機能の現状Ryusuke Kajiyama
 
2017年5月26日 オープンソースデータベース比較セミナー「NoSQLとしても使えるMySQLとMySQL Cluster」
2017年5月26日 オープンソースデータベース比較セミナー「NoSQLとしても使えるMySQLとMySQL Cluster」2017年5月26日 オープンソースデータベース比較セミナー「NoSQLとしても使えるMySQLとMySQL Cluster」
2017年5月26日 オープンソースデータベース比較セミナー「NoSQLとしても使えるMySQLとMySQL Cluster」Ryusuke Kajiyama
 
第20回 中国地方DB勉強会 in 岡山 MySQLレプリケーション
第20回 中国地方DB勉強会 in 岡山 MySQLレプリケーション第20回 中国地方DB勉強会 in 岡山 MySQLレプリケーション
第20回 中国地方DB勉強会 in 岡山 MySQLレプリケーションRyusuke Kajiyama
 
[Java Küche RDB 最前線 2015] MySQL 5.7技術アップデート
[Java Küche RDB 最前線 2015] MySQL 5.7技術アップデート[Java Küche RDB 最前線 2015] MySQL 5.7技術アップデート
[Java Küche RDB 最前線 2015] MySQL 5.7技術アップデートRyusuke Kajiyama
 
[db tech showcase 2015 Sapporo HOKKAIDO] MySQL as document database!?
[db tech showcase 2015 Sapporo HOKKAIDO] MySQL as document database!?[db tech showcase 2015 Sapporo HOKKAIDO] MySQL as document database!?
[db tech showcase 2015 Sapporo HOKKAIDO] MySQL as document database!?Ryusuke Kajiyama
 
[db tech showcase 2015 Sapporo HOKKAIDO] MySQL 5.7
[db tech showcase 2015 Sapporo HOKKAIDO] MySQL 5.7[db tech showcase 2015 Sapporo HOKKAIDO] MySQL 5.7
[db tech showcase 2015 Sapporo HOKKAIDO] MySQL 5.7Ryusuke Kajiyama
 
TWJUG August, What's new in MySQL 5.7 RC
TWJUG August, What's new in MySQL 5.7 RCTWJUG August, What's new in MySQL 5.7 RC
TWJUG August, What's new in MySQL 5.7 RCRyusuke Kajiyama
 
TWJUG August, MySQL JDBC Driver "Connector/J"
TWJUG August, MySQL JDBC Driver "Connector/J"TWJUG August, MySQL JDBC Driver "Connector/J"
TWJUG August, MySQL JDBC Driver "Connector/J"Ryusuke Kajiyama
 
MySQL 5.7 & 最新開発状況 @ オープンソースカンファレンス20
MySQL 5.7 & 最新開発状況 @ オープンソースカンファレンス20MySQL 5.7 & 最新開発状況 @ オープンソースカンファレンス20
MySQL 5.7 & 最新開発状況 @ オープンソースカンファレンス20Ryusuke Kajiyama
 
MySQLのNoSQL機能 - MySQL JSON & HTTP Plugin for MySQL
MySQLのNoSQL機能 - MySQL JSON & HTTP Plugin for MySQLMySQLのNoSQL機能 - MySQL JSON & HTTP Plugin for MySQL
MySQLのNoSQL機能 - MySQL JSON & HTTP Plugin for MySQLRyusuke Kajiyama
 
第九回中国地方DB勉強会 in 米子 MySQL 5.7+
第九回中国地方DB勉強会 in 米子 MySQL 5.7+第九回中国地方DB勉強会 in 米子 MySQL 5.7+
第九回中国地方DB勉強会 in 米子 MySQL 5.7+Ryusuke Kajiyama
 
MySQL Cluster as Transactional NoSQL (KVS)
MySQL Cluster as Transactional NoSQL (KVS)MySQL Cluster as Transactional NoSQL (KVS)
MySQL Cluster as Transactional NoSQL (KVS)Ryusuke Kajiyama
 
20150131 ChugokuDB-Shimane-MySQL
20150131 ChugokuDB-Shimane-MySQL20150131 ChugokuDB-Shimane-MySQL
20150131 ChugokuDB-Shimane-MySQLRyusuke Kajiyama
 
[Preview] MySQL session at Open Source Conference 2014 .Enterprise Osaka
[Preview] MySQL session at Open Source Conference 2014 .Enterprise Osaka[Preview] MySQL session at Open Source Conference 2014 .Enterprise Osaka
[Preview] MySQL session at Open Source Conference 2014 .Enterprise OsakaRyusuke Kajiyama
 
20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech Updates20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech UpdatesRyusuke Kajiyama
 

More from Ryusuke Kajiyama (20)

[OSC 2020 Online/Nagoya] MySQLドキュメントストア
[OSC 2020 Online/Nagoya] MySQLドキュメントストア[OSC 2020 Online/Nagoya] MySQLドキュメントストア
[OSC 2020 Online/Nagoya] MySQLドキュメントストア
 
[OSC 2020 Osaka] MySQL"超"入門
[OSC 2020 Osaka] MySQL"超"入門[OSC 2020 Osaka] MySQL"超"入門
[OSC 2020 Osaka] MySQL"超"入門
 
[中国地方DB勉強会] 第22回 Webアプリ開発をデータベース側から変革していく - MySQL 8.0新機能
[中国地方DB勉強会] 第22回 Webアプリ開発をデータベース側から変革していく - MySQL 8.0新機能[中国地方DB勉強会] 第22回 Webアプリ開発をデータベース側から変革していく - MySQL 8.0新機能
[中国地方DB勉強会] 第22回 Webアプリ開発をデータベース側から変革していく - MySQL 8.0新機能
 
[OSC 2017 Tokyo/Fall] OSSコンソーシアム DB部会 MySQL 8.0
[OSC 2017 Tokyo/Fall] OSSコンソーシアム DB部会 MySQL 8.0[OSC 2017 Tokyo/Fall] OSSコンソーシアム DB部会 MySQL 8.0
[OSC 2017 Tokyo/Fall] OSSコンソーシアム DB部会 MySQL 8.0
 
[db tech showcase 2017 Tokyo] D31 - MySQL 8.0の日本語キャラクタ・セットと文字照合
[db tech showcase 2017 Tokyo] D31 - MySQL 8.0の日本語キャラクタ・セットと文字照合[db tech showcase 2017 Tokyo] D31 - MySQL 8.0の日本語キャラクタ・セットと文字照合
[db tech showcase 2017 Tokyo] D31 - MySQL 8.0の日本語キャラクタ・セットと文字照合
 
[db tech showcase 2017 Tokyo] A23 - MySQLのセキュリティ関連機能の現状
[db tech showcase 2017 Tokyo] A23 - MySQLのセキュリティ関連機能の現状[db tech showcase 2017 Tokyo] A23 - MySQLのセキュリティ関連機能の現状
[db tech showcase 2017 Tokyo] A23 - MySQLのセキュリティ関連機能の現状
 
2017年5月26日 オープンソースデータベース比較セミナー「NoSQLとしても使えるMySQLとMySQL Cluster」
2017年5月26日 オープンソースデータベース比較セミナー「NoSQLとしても使えるMySQLとMySQL Cluster」2017年5月26日 オープンソースデータベース比較セミナー「NoSQLとしても使えるMySQLとMySQL Cluster」
2017年5月26日 オープンソースデータベース比較セミナー「NoSQLとしても使えるMySQLとMySQL Cluster」
 
第20回 中国地方DB勉強会 in 岡山 MySQLレプリケーション
第20回 中国地方DB勉強会 in 岡山 MySQLレプリケーション第20回 中国地方DB勉強会 in 岡山 MySQLレプリケーション
第20回 中国地方DB勉強会 in 岡山 MySQLレプリケーション
 
[Java Küche RDB 最前線 2015] MySQL 5.7技術アップデート
[Java Küche RDB 最前線 2015] MySQL 5.7技術アップデート[Java Küche RDB 最前線 2015] MySQL 5.7技術アップデート
[Java Küche RDB 最前線 2015] MySQL 5.7技術アップデート
 
[db tech showcase 2015 Sapporo HOKKAIDO] MySQL as document database!?
[db tech showcase 2015 Sapporo HOKKAIDO] MySQL as document database!?[db tech showcase 2015 Sapporo HOKKAIDO] MySQL as document database!?
[db tech showcase 2015 Sapporo HOKKAIDO] MySQL as document database!?
 
[db tech showcase 2015 Sapporo HOKKAIDO] MySQL 5.7
[db tech showcase 2015 Sapporo HOKKAIDO] MySQL 5.7[db tech showcase 2015 Sapporo HOKKAIDO] MySQL 5.7
[db tech showcase 2015 Sapporo HOKKAIDO] MySQL 5.7
 
TWJUG August, What's new in MySQL 5.7 RC
TWJUG August, What's new in MySQL 5.7 RCTWJUG August, What's new in MySQL 5.7 RC
TWJUG August, What's new in MySQL 5.7 RC
 
TWJUG August, MySQL JDBC Driver "Connector/J"
TWJUG August, MySQL JDBC Driver "Connector/J"TWJUG August, MySQL JDBC Driver "Connector/J"
TWJUG August, MySQL JDBC Driver "Connector/J"
 
MySQL 5.7 & 最新開発状況 @ オープンソースカンファレンス20
MySQL 5.7 & 最新開発状況 @ オープンソースカンファレンス20MySQL 5.7 & 最新開発状況 @ オープンソースカンファレンス20
MySQL 5.7 & 最新開発状況 @ オープンソースカンファレンス20
 
MySQLのNoSQL機能 - MySQL JSON & HTTP Plugin for MySQL
MySQLのNoSQL機能 - MySQL JSON & HTTP Plugin for MySQLMySQLのNoSQL機能 - MySQL JSON & HTTP Plugin for MySQL
MySQLのNoSQL機能 - MySQL JSON & HTTP Plugin for MySQL
 
第九回中国地方DB勉強会 in 米子 MySQL 5.7+
第九回中国地方DB勉強会 in 米子 MySQL 5.7+第九回中国地方DB勉強会 in 米子 MySQL 5.7+
第九回中国地方DB勉強会 in 米子 MySQL 5.7+
 
MySQL Cluster as Transactional NoSQL (KVS)
MySQL Cluster as Transactional NoSQL (KVS)MySQL Cluster as Transactional NoSQL (KVS)
MySQL Cluster as Transactional NoSQL (KVS)
 
20150131 ChugokuDB-Shimane-MySQL
20150131 ChugokuDB-Shimane-MySQL20150131 ChugokuDB-Shimane-MySQL
20150131 ChugokuDB-Shimane-MySQL
 
[Preview] MySQL session at Open Source Conference 2014 .Enterprise Osaka
[Preview] MySQL session at Open Source Conference 2014 .Enterprise Osaka[Preview] MySQL session at Open Source Conference 2014 .Enterprise Osaka
[Preview] MySQL session at Open Source Conference 2014 .Enterprise Osaka
 
20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech Updates20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech Updates
 

MySQL Performance Tuning at COSCUP 2014

  • 1. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1 MySQL Performance Tuning MySQL Global Business Unit Sales Consulting Senior Manager, JAPAC 梶山 隆輔 / Ryusuke Kajiyama
  • 2. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. MAKE MySQL a Better MySQL
  • 3. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.3 MySQL 5.5 MySQL Cluster 7.3 MySQL Enterprise Monitor 2.3 MySQL Enterprise Backup Security Scalability HA Audit MySQL 5.6 MySQL Workbench 6.0 MySQL Utilities MySQL Applier for Hadoop MySQL Workbench 5.2 MySQL Enterprise Oracle Certifications Over 3,5 Years of MySQL Innovation MySQL Cluster Manager Windows installer & Tools MySQL Cluster 7.2 MySQL Cluster 7.1 MySQL Migration Wizard
  • 4. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4 MySQL: Everywhere and Growing Platform of Choice for Next Generation Web, Cloud & Embedded Applications World’s Most Popular Open Source Database Database Platform for Next Gen Web Apps Leading Database for Web Applications Leading Database in the Cloud Integrated with Hadoop in majority of Big Data platforms #1 Linux Career IT skill: MySQL * * Source: Linux Career IT Skills Watch update July 2013 Downloads & Sales Growth Best of both Worlds SQL+NoSQL LAMP + Python +Node.js + Go +... Awards & Social Media Momentum
  • 5. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.5 MySQL 5.6: Best Release Ever!
  • 6. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6 MySQL 5.6: Scalability  Users can fully utilize latest generations of hardware and OS  Scales as data volumes and users grow
  • 7. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.7 MySQL 5.5 MySQL 5.6 MySQL 5.6 SysBench Benchmarks Up to 234% Performance Gain
  • 8. Replication Binary Log Group Commit • Days of losing 50%+ master performance are gone! • 10% overhead when configuring sync_binlog=0 • Additional 5% when configuring sync_binlog=1 https://blogs.oracle.com/MySQL/entry/mysql_5_6_replication_performance
  • 9. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9 Same app can leverage:  Key-value access to InnoDB via familiar Memcached API  SQL for rich queries, JOINs, FKs, etc.  Fully transactional MySQL 5.6: InnoDB NoSQL Key Value Access to InnoDB  Up to 9x performance boost for updates  Great for fast data ingestion in Big Data pipeline
  • 10. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10 MySQL 5.6: Optimizer
  • 11. • Simple word but many meanings • Main objective: • Users (direct or indirect) should be satisfied • Most typical performance metrics • Throughput • Latency / Response time • Scalability • Combined metrics Starvation transactions/time Defining Performance
  • 12. • Multi User applications • Request waits in queue before being processed • User response time = queueing delay + service time • Non high tech example – support call center. • “Hockey Stick” - queuing delay grows rapidly when system getting close to saturation • Need to improve queueing delay or service time to improve performance • Improving service time reduces queuing delay Connections ResponseTime Queuing Theory
  • 13. • Main Question – where does service time comes from ? • network, cpu, disk, locks... • Direct Measurements • Sum up all query times from web pages • Indirect measurements • CPU usage • Disk IO latency • Network traffic • Load Average • Number of running queries • etc. Service Time: Key to the hotspot
  • 14. Benchmark Tests • Great tool to: • Quantify application performance • Measure performance effect of the changes • Validate Scalability • Plan deployment • But • Can be very misleading if done wrong • Need to be able to read results correctly • Typical Errors • Testing with 1GB size with 100G in production • Using uniform distribution • “Harry Potter” ordered as frequent as Zulu dictionary • Testing in single user scenario
  • 15. Benchmark Tools for MySQL • Creating own benchmark tool – Generating from SQL statements in General Log – Fetching SQL statements with MySQL Proxy or TCP Dump • DBT2 – http://osdldbt.sourceforge.net/ – http://nippondanji.blogspot.com/2009/03/dbt-2.html • mysqlslap MySQL 5.1 + – http://dev.mysql.com/doc/refman/5.6/en/mysqlslap.html • SysBench – http://sysbench.sourceforge.net/
  • 16. • Performance costs money, whatever road you take • Investigate different possibilities • Better hardware could be cheaper than a major rewrite • How much performance/scalability/reliability do you need ? • 99.999% could be a lot more expensive than 99.9% • Is peak traffic requirements 100x average or just 3x ? • Take a look at whole picture • Is this the largest risk/bottleneck ? • Identify which optimizations are critical for business • Optimization of “everything” is often waste of resources • What is the cost of suboptimal performance ? Business side of optimization
  • 17. Basic1: Checking Server Configurations • The MySQL server is controlled by “System Variables” • Set via: • Option File:   my.cnf / my.ini • Temporary change: SET [GLOBAL] <vriable>=<value> • Can be per connection (LOCAL) or server wide(GLOBAL)
  • 18. Basic2: Checking Status of Server  Monitor system performance using “Status Variables” • Knowing internal commands of one query Mysql> FLUSH STATUS; <run query>; SHOW STATUS; • Checking status periodically shell> mysqladmin -u -p ... ex -i 15 -r | grep -v ‘ 0 ‘ http://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html
  • 19. Client2 ClientN Connection Thread Pool Parser Query 101101 Client1 Optimizer Storage Engines  InnoDB  MyISAM  MERGE  MEMORY  ARCHIVE Query Cache MySQL Server MySQL Server Architecture
  • 20. • max_connections (151) • number of connections server will allow. May run out of memory if too high, because of per connections memory usage • thread_cache_size (8) • Keep up to this amount of threads “cached” after disconnect • Typical setting max_connections/3 Client2 ClientN Connection Thread Pool Client1 mysql> show status; • Max_used_connections • check if it matches max_connections, too low value or sign of overload • Threads_created • thread_cache misses • should be low. Server Connections & Threads
  • 21. • sort_buffer_size (2M) • Memory to allocate for sort. Will use disk based sort for larger data sets. Often fine at 512K or 1M • other buffers, read, read_rnd, etc… smaller defaults often OK • You can change dynamically if large sort operation is needed in batch operation etc Client2 ClientN Connection Thread Pool Client1 mysql> show status; • Sort_merge_passes - • number of passes made during file merge sort. • check if file sort needs to be done at all • use index if possible Connection Thread Work Buffers
  • 22. • query_cache_size (0) • Amount of memory to use for query cache • Typically 32M is fine, some databases need 128M • query_cache_type (ON) • Worst case performance overhead is about 15%-20% • Favors servers with higher SELECT/WRITE ratios • Best Practice • Set to DEMAND • Add SQL_CACHE to appropriate queries Connection Thread Pool Parser Query 101101 Query Cache mysql> show status; • Qcache_hits, Qcache_inserts • hits/inserts cache hit ratio, if small, maybe disable query cache • Qcache_lowmem_prunes • times older queries were removed due to low memory, need to increase query_cache_size if high Server Query Cache
  • 23. • innodb_buffer_pool_size • 80% of memory on Innodb only system • caches data & indexes unlike MyISAM • innodb_log_file_size • A key parameter for write performance • Recovery time is no more an issue. • Bigger is better for write QPS stability • innodb_flush_log_at_trx_commit • 1 (slow) will flush (fsync) log at each commit. Truly ACID • 2 (fast) will only flush log buffer to OS cache on commit, sync to disk once/sec. • 0 (fastest) will flush (fsync) log every second or so • innodb_file_per_table • Always good choice to distribute i/o • Default ON from 5.6 Storage Engines  InnoDB  MyISAM  MERGE  MEMORY ARCHIVE mysql> SHOW ENGINE INNODB STATUS; Great way to see what is going on inside InnoDB, hard to parse • File IO • Buffer Pool • Log activity • Row activity InnoDB Performance Tips
  • 24. • innodb_flush_method = O_DIRECT • Not to consume OS cache • innodb_buffer_pool_instances (5.5+) • To avoid mutex contention • 2 or more in can • innodb_io_capacity (5.5+) • Enlarge if you have fast disks • Default 200 is good for 2 disks striped • innodb_read_io_threads (5.5+) • innodb_write_io_threads (5.5+) • Enlarge if you have fast disks • Default 4 is usually good enough Storage Engines  InnoDB  MyISAM  MERGE  MEMORY ARCHIVE mysql> SHOW ENGINE INNODB STATUS; Great way to see what is going on inside InnoDB, hard to parse • File IO • Buffer Pool • Log activity • Row activity InnoDB Performance Tips (Cont.)
  • 25. DBT-2 (W200) Transactions per Minute %user %iowait Buffer pool 1G 1125.44 2% 30% Buffer pool 2G 1863.19 3% 28% Buffer pool 5G 4385.18 5.5% 33% Buffer pool 30G (All data in cache) 36784.76 36% 8% Semi-in-memory Database with InnoDB • DBT-2 benchmark (write intensive) • 20-25GB hot data (200 warehouses, running 1 hour) • Nehalem 2.93GHz x 8 cores, MySQL 5.5.2, 4 RAID1+0 HDDs • RAM size affects everything. Not only for SELECT, but also for INSERT/UPDATE/DELETE • INSERT: Random reads/writes happen when inserting into indexes in random order • UPDATE/DELETE: Random reads/writes happen when modifying records
  • 26. • Normalization • good for OLTP, writes • data redundancies eliminated • join performance penalty • smaller total data set • E/R diagram clean translation • Denormalization • good for OLAP, reporting • data redundancies across tables for better indexing • maybe eliminate joins • Data types – use tinyint, smallint, mediumint, save space! – join columns same data type – varchar(64) instead of char(64) – declare NOT NULL if true – varchar(64) instead of varchar(255) – INT not DECIMAL(9) • Indexing – multi-column – ordered BTREE – index prefixes – covering Schema Design
  • 27. #Time: 08073101 16:25:24 #User@Host: root[root] @ localhost [127.0.0.1] #Query_time: 8 Lock_time: 0 Rows_sent: 20 Rows_examined: 243661 SELECT part_num FROM `inventory`.`parts` WHERE (`ven` = "foo") ORDER BY `delivery_datetime` DESC LIMIT 100; Monitoring Queries - Slow Query Log Cons • Requires MySQL restart (5.0 and lower) • Growth must be managed using FLUSH LOGS • Entries must be parsed/sorted for relevance • mysqldumpslow helps, but still tedious, takes time Pros • Logs queries that took longer than X (user defined) • Logs queries that do not use indexes (5.0 and higher) • Includes data needed to trace offending queries
  • 28. Monitoring Queries – SHOW PROCESSLIST; mysql> SHOW FULL PROCESSLISTG ******** 1. row ***************** Id: 1 User: MyUser Host: localhost db: inventory Command: Query Time: 1030455 State: Sending Data Info: SELECT part_num from ‘inv’; ….. 2 rows in set (0.00 sec) Pros • Shows current processes • Shows status of executing queries • Includes data needed to trace offending queries Con Scripting needed to: • automate, • integrate with Slow Query Log, • Aggregate/parse results for analysis, • notify DBA of problem
  • 29. Fixing Problem Queries – EXPLAIN; EXPLAIN SELECT part_num FROM `inventory`.`parts` WHERE (`ven` = "foo") ORDER BY `delivery_datetime` DESC LIMIT 100;G ******** 1. row ************* ID: 1 select_type: SIMPLE table: parts type: ref possible_keys: ven, part# key: ven key_len: 3 ref: null rows: 872 Extra: Using WHERE 1 row in set (0.00 sec) Analyze • How indexes are being used (or not…) • required filesorts • What tables, columns are being queried Fix/Tune - involves iterations of: • Add/alter indexes • Alter tables, columns, datatypes • Alter query structure • Test, 10 GOTO 10 until done
  • 30. Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1230 MySQL Enterprise Monitor  Real-time MySQL performance and availability monitoring  Visually find & fix problem queries  Disk monitoring for capacity planning  Cloud friendly architecture (no agents)  Start monitoring MySQL in 10 minutes  Remote agent option provides OS monitoring
  • 31. Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1231 MySQL Query Analyzer  Real-time query performance  Visual correlation graphs  Find & fix expensive queries  Detailed query statistics  Query Response Time index (QRTi) “With the MySQL Query Analyzer, we were able to identify and analyze problematic SQL code, and triple our database performance. More importantly, we were able to accomplish this in three days, rather than taking weeks.” Keith Souhrada Software Development Engineer Big Fish Games
  • 32. MySQL Enterprise Scalability MySQL Thread Pool • MySQL default thread-handling – excellent performance, can limit scalability as connections grow • MySQL Thread Pool improves sustained performance/scale as user connections grow • Thread Pool API New!
  • 33. MySQL Enterprise Scalability Configuration MySQL 5.6.11 Oracle Linux 6.3, Unbreakable Kernel 2.6.32 4 sockets, 24 cores, 48 Threads Intel(R) Xeon® E7540 2GHz CPUs 512GB DDR RAM
  • 34. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.34 Performance Schema in MySQL 5.5 & MySQL 5.6
  • 35. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.35 Performance Schema in MySQL 5.5 Laid out the framework for instrumentation Focused early on low level instruments – Prove it could handle load, build from ground up Not turned on by default, had some overhead issues
  • 36. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.36 Performance Schema in MySQL 5.5 17 Tables 222 Instruments Instrument Event Class File IO wait/io/file/% Mutexes wait/synch/mutex/% Read/Write Locks wait/synch/rwlock/% Conditions wait/synch/cond/%
  • 37. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.37 Performance Schema in MySQL 5.5
  • 38. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.38 Performance Schema in MySQL 5.6 Fixed lots of performance issues Focused on bringing the instrumentation to the DBA / Developer Statements / Statement Digests Execution Stages Object tracking (table / index IO, table locks) Network IO Turned on by default, with a subset of instrumentation disabled
  • 39. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.39 Performance Schema in MySQL 5.6 52 Tables (+35) 545 Instruments (+323) Instrument Type Event Class Statements statement/% Stages stage/% Table IO wait/io/table/% Table Locks wait/lock/table/% Network IO wait/io/socket/% Idle Timing idle
  • 40. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.40 Performance Schema in MySQL 5.6
  • 41. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.41 Improvements made to date in MySQL 5.7
  • 42. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 Insert Picture Here 42 Memory Usage Metadata Locking Replication Configuration & Status Prepared Statements Transactions Stored Programs
  • 43. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.43 Improvements made to date in MySQL 5.7 75 Tables (+23) 784 Instruments (+239) Instrument Type Event Class Transactions transaction Memory memory/% Metadata Locks wait/lock/metadata/%
  • 44. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.44 Improvements made to date in MySQL 5.7
  • 45. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.45 DMRs: Development Milestone Releases  Fully Functional Release Candidate Quality  Two to Four per Year  Early Community Testing, Use, & Feedback  Accelerates Rate of Enhancements  Improves Quality
  • 46. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.46 MySQL 5.7  InnoDB for better transactional throughput, availability  Replication for better scalability and availability  Utilities for dev/ops automation  Performance Schema for better performance metrics  Optimizer for better EXPLAINing query performance Available Now! Get it here: MySQL 5.7.2 builds on MySQL 5.6 by improving: dev.mysql.com/downloads/mysql/ New!
  • 47. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.47 MySQL 5.7 Sysbench Benchmarks Sysbench Point Select Intel(R) Xeon(R) CPU X7560 x86_64 4 sockets x 8 cores-HT (64 CPU threads) 2.27GHz, 256G RAM Oracle Linux 6.2 95% Faster than MySQL 5.6 172% Faster than MySQL 5.5 500,000 QPS
  • 48. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.48 RO In-Memory @MySQL 5.7  Sysbench OLTP_RO 8-tables, 32cores-HT :
  • 49. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.49 RO In-Memory @MySQL 5.7
  • 50. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.50
  • 51. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.51 第一次台灣 MySQL 社群聚會  我們將在 7 月 22 日下午 6:00 到 8:00 借用台北市忠孝西路 一段 35 樓甲骨文的會議室,舉辦第一次台灣 MySQL 社群 聚會,歡迎您抽空參加。在聚會中我們將會中提供簡單的晚 餐,同時分享 MySQL 的最新動態,包括: – 展示如何用新發表的 MySQL Fabric 支持上 PB 級資料的應用系統, 做資料庫分表分庫,高可用和讀寫分離 – MySQL 5.7.4 DMR 的新功能和産品發展路線  也非常歡迎您分享您的心得和意見如果您打算參加 22 日的 聚會,或打算分享您的心得 1st TWMUG meeting

Editor's Notes

  1. Since Oracle acquired Sun we have delivered A TON of MySQL Innovation Go through the different deliverables We’ve improved the MySQL experience for users, customers, for folks using MySQL on Windows, for Oracle customers using MySQL...etc In case anyone still has any doubt about Oracle’s commitment to MySQL, those doubts clearly can be put to rest. We’re delivering more than ever before in MySQL’s history, and will continue to do so.
  2. MySQL is in an incredibly favorable position, and the platform of choice for next generation Web, mobile and cloud applications. It is....(the 4 key points) We’re also seeing great momentum for MySQL: talk about 3 points on the side We want to ensure that MySQL remains the platform of choice for next gen web apps, and we are evolving the database by developing new features, enhancements and integrating in it new capabilities useful for modern apps. Give example of the 2 other points in orange (NoSQL and new languages)
  3. MySQL 5.6 delivers across the board improvements designed to enable innovative DBAs and Developers to create and deploy the next generation of web, embedded and Cloud/SaaS/DaaS applications on the latest generation of development frameworks and hardware platforms. At a glance, MySQL 5.6 is simply a better MySQL with improvements that enhance every functional area of the database kernel, including:   Improved Performance Scalability 5.6 scales up 48 CPU threads which enables users to leverage the full processing power of modern architectures 5.6 performs up to 230% faster over 5.5 on transactional work loads. Improved InnoDB Allow 5.6 to provide better transactional throughput and availability over previous versions. Improved Optimizer Provides better query execution times and more diagnostics for monitoring, tuning and debugging Impoved Replication Provides higher performance, availability and data integrity Improved Performance Schema Provides better instrumentation and user/application level statistics and monitoring New! NoSQL Access to InnoDB Provides fast, Key Value access with full ACID compliance, better developer agility Improved InnoDB storage engine for better transactional throughput Improved Optimizer for better query execution times and diagnostics Better Application Availability with Online DDL/Schema changes Better Developer Agility with NoSQL Access with Memcached API to InnoDB Improved Replication for high performance, self-healing distributed deployments Improved Performance Schema for better instrumentation Improved Security for worry-free application deployments And other Important Enhancements
  4. In MySQL 5.6 performance has been improved to provide better linear performance and scale on systems supporting multi-processors and high CPU thread concurrency. Internal benchmarks for SysBench Read/Write and Read Only workloads show a marked improvement in scale over the most current version of MySQL 5.5. For Linux, SysBench Read/Write benchmarks show that 5.6 scales “up and to the right” on &amp;gt; 48 CPU threads/cores. Similar improvements have been delivered on Windows.
  5. For Linux, SysBench Read Only benchmarks show that 5.6 performance is improved up to 234% over 5.5 at the same user concurrency. Similar improvements have been delivered on Windows.
  6. Many of the latest generation of web, cloud, social and mobile applications require fast operations against simple Key/Value pairs. At the same time, they must retain the ability to run complex queries against the same data, as well as ensure the data is protected with ACID guarantees. With the new NoSQL API for InnoDB, developers have all the benefits of a transactional RDBMS, coupled with the performance capabilities of Key/Value store.   MySQL 5.6 provides simple, key-value interaction with InnoDB data via the familiar Memcached API. Implemented via a new Memcached daemon plug-in to mysqld, the new Memcached protocol is mapped directly to the native InnoDB API and enables developers to use existing Memcached clients to bypass the expense of query parsing and go directly to InnoDB data for lookups and transactional compliant updates. The API makes it possible to re-use standard Memcached libraries and clients, while extending Memcached functionality by integrating a persistent, crash-safe, transactional database back-end.
  7. Real-time MySQL Performance and Availability Monitoring Visual Dashboad for Better Visibility Visually Find and Fix Problem Queries Pinpoint SQL code that causing a slowdown Visual Capacity Planning Forecasting using Projections and Trend Analysis Agentless, Cloud Friendly Architecture Remotely Monitor MySQL without agents Start Monitoring MySQL in 10 minutes Easy to use with zero configuration