Tips for MySQL Performance
in 30mn
AFUP
20 Janvier 2015
Olivier Zemrag
MySQL Architect
About me
Wonderful 18 Years of IT Technology
More than 10 Years with MySQL family
Worked with startups large compagnie suc...
Agenda
Introduction
Configuration
Hardware
Design
MySQL popularity performance
http://db-engines.com
Find the 'next' Bottleneck
Bench your work load
Test test test
Monitor monitor monitor
Think cost / effort
Change one thin...
Configuration
● Buffer pool
● Log file size
● Other variables
Use large Buffer Pool
● The most important variable with InnoDB
Example : for 32G use 20G for
innodb_buffer_pool_size (or ...
Tunne Innodb Log files
For .write heavy workloads use big
Innodb_log_file_size
Be aware of time of restart process
Take ca...
Other variables
● innodb_file_per_table=1
● innodb_stat_on_metadata=OFF
● Check :
– Innodb_flush_at_trx_commit (Durability...
hardware
● RAM
● CPU
● Storage
CPU
● Faster is better for query response time
● More cores for more concurrency
MEMORY
● Size of the frequently used data (working set)
● Check response time and throughput
Storage
● RAID10
● SSD
● Fusion IO
● SAN
● Mix :
– HDD : log-bin, log-files
– SSD : datadir, innodb_undo_directory, tmpdir
Design
● Optmize, purge, archive data
● Proper Indexation
● Proper usage of temporary tables
– Example of usage of perform...
Other Tips & Futures
● Optimize your OS, Optimize your Network
● NoSQL with memcached & InnoDB
● NDB (MySQL Cluster) for h...
Merci
Questions ?
Olivier Zemrag
http://ozemrag.blogspot.fr/
Prochain SlideShare
Chargement dans…5
×

Top tips my_sql_performance

2 002 vues

Publié le

Présentation effectuée au Rendez-vous de l'AFUP Paris le 20 janvier 2015 par Olivier Zemrag

Publié dans : Internet
0 commentaire
0 j’aime
Statistiques
Remarques
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Aucun téléchargement
Vues
Nombre de vues
2 002
Sur SlideShare
0
Issues des intégrations
0
Intégrations
655
Actions
Partages
0
Téléchargements
19
Commentaires
0
J’aime
0
Intégrations 0
Aucune incorporation

Aucune remarque pour cette diapositive

Top tips my_sql_performance

  1. 1. Tips for MySQL Performance in 30mn AFUP 20 Janvier 2015 Olivier Zemrag MySQL Architect
  2. 2. 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
  3. 3. Agenda Introduction Configuration Hardware Design
  4. 4. MySQL popularity performance http://db-engines.com
  5. 5. Find the 'next' Bottleneck Bench your work load Test test test Monitor monitor monitor Think cost / effort Change one thing at a time Test test test Monitor monitor monitor
  6. 6. Configuration ● Buffer pool ● Log file size ● Other variables
  7. 7. Use large Buffer Pool ● The most important variable with InnoDB Example : for 32G use 20G for innodb_buffer_pool_size (or even more) ● Be aware off swaping  and other settings !!
  8. 8. Tunne Innodb Log files For .write heavy workloads use big Innodb_log_file_size Be aware of time of restart process Take caution when you change it
  9. 9. 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 you know what you do or change per session only
  10. 10. hardware ● RAM ● CPU ● Storage
  11. 11. CPU ● Faster is better for query response time ● More cores for more concurrency
  12. 12. MEMORY ● Size of the frequently used data (working set) ● Check response time and throughput
  13. 13. Storage ● RAID10 ● SSD ● Fusion IO ● SAN ● Mix : – HDD : log-bin, log-files – SSD : datadir, innodb_undo_directory, tmpdir
  14. 14. Design ● Optmize, purge, archive data ● Proper Indexation ● Proper usage of temporary tables – Example of usage of performance_schema to find queries creating temporary tables (version 5.6) SELECT * FROM events_statements_summary_by_digest WHERE SUM_CREATED_TMP_TABLES > 0
  15. 15. 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
  16. 16. Merci Questions ? Olivier Zemrag http://ozemrag.blogspot.fr/

×