Top Banner
Tips for MySQL Performance in 30mn AFUP 20 Janvier 2015 Olivier Zemrag MySQL Architect
16
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Top tips my_sql_performance

Tips for MySQL Performancein 30mn

AFUP

20 Janvier 2015

Olivier ZemragMySQL Architect

Page 2: Top tips my_sql_performance

About me

Wonderful 18 Years of IT Technology

More than 10 Years with MySQL family Worked with startups large compagnie such as L’OREAL, ALCATEL,ORANGE, ...

MySQL & open source user since 2000

MySQL Consultant in 2006 at ANASKA

MySQL consultant at SUN in 2008

6 years member of MySQL Oracle Team

Now MySQL Architect

Page 3: Top tips my_sql_performance

Agenda

IntroductionConfiguration

HardwareDesign

Page 4: Top tips my_sql_performance

MySQL popularity performancehttp://db-engines.com

Page 5: Top tips my_sql_performance

Find the 'next' Bottleneck Bench your work load

Test test test Monitor monitor monitor

Think cost / effortChange one thing at a time

Test test testMonitor monitor monitor

Page 6: Top tips my_sql_performance

Configuration

● Buffer pool

● Log file size

● Other variables

Page 7: Top tips my_sql_performance

Use large Buffer Pool

● The most important variable with InnoDB

Example : for 32G use 20G forinnodb_buffer_pool_size (or even more)

● Be aware off swaping  and other settings !!

Page 8: Top tips my_sql_performance

Tunne Innodb Log files

For .write heavy workloads use bigInnodb_log_file_size

Be aware of time of restart process

Take caution when you change it

Page 9: Top tips my_sql_performance

Other variables

● innodb_file_per_table=1

● innodb_stat_on_metadata=OFF

● Check :

– Innodb_flush_at_trx_commit (Durability)

– innodb_flush_method (O_DIRECT)

– skip_name_resolved

● Leave all other variables to default unless youknow what you do or change per session only

Page 10: Top tips my_sql_performance

hardware

● RAM

● CPU

● Storage

Page 11: Top tips my_sql_performance

CPU

● Faster is better for query response time

● More cores for more concurrency

Page 12: Top tips my_sql_performance

MEMORY

● Size of the frequently used data (working set)

● Check response time and throughput

Page 13: Top tips my_sql_performance

Storage

● RAID10

● SSD

● Fusion IO

● SAN

● Mix :– HDD : log-bin, log-files

– SSD : datadir, innodb_undo_directory, tmpdir

Page 14: Top tips my_sql_performance

Design

● Optmize, purge, archive data

● Proper Indexation

● Proper usage of temporary tables

– Example of usage of performance_schema to findqueries creating temporary tables (version 5.6)

SELECT * FROMevents_statements_summary_by_digest

WHERE SUM_CREATED_TMP_TABLES > 0

Page 15: Top tips my_sql_performance

Other Tips & Futures

● Optimize your OS, Optimize your Network

● NoSQL with memcached & InnoDB

● NDB (MySQL Cluster) for high write workloads

● Mix & match InnoDB, memcacehd, NDB Cluster

● MySQL Fabric for sharding

Page 16: Top tips my_sql_performance

Merci

Questions ?

Olivier Zemrag

http://ozemrag.blogspot.fr/