Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

M|18 Where and How to Optimize for Performance

79 views

Published on

M|18 Where and How to Optimize for Performance

Published in: Data & Analytics
  • Be the first to comment

  • Be the first to like this

M|18 Where and How to Optimize for Performance

  1. 1. Where And How To Optimize For Performance Tuesday, February 27 Operatio ns 8:40 pm - 9:30 pm Jens Bollmann, Instructor/Consultant
  2. 2. ● Consulting worldwide – Performance Tuning – High Availability – Architecture – Security ● Instructor – All MariaDB curriculum – Certification preparation
  3. 3. Defining Performance User (internal and external) satisfaction Metrics: Throughput Responsetime Scalability
  4. 4. Throughput Transactionsprocessed per second
  5. 5. Response time Timein secondsor minutes Min Max Average
  6. 6. Scalability Maintain performancewith changesin Load Concurrency Databasesize
  7. 7. Service Time Identify wheretimewasspent CPU I/O Memory Network (cluster environment) etc. Tools Profiling Performanceschema
  8. 8. Benchmarks sysbench v 1.0 availablesinceFOSDEM 2017 (fair) mysqlslap (unfair) Can bemisleading Usereal dataset and real target env
  9. 9. Focus ImproveHardware(CPU) 32 → 64 YES Memory YES Assign to buffers YES → makeuseof memory Query optimization and Index UsageYES
  10. 10. Query Cache By default off Global Locks ObserveRead or WriteHeavy Server Mariadb> SHOW STATUS LIKE 'Qcache%';
  11. 11. Temporary Tables EXPLAIN queries Identify creation of tmp tablesin Extra Bad if disk tablesareused Mariadb> SHOW STATUS LIKE 'Cre%tmp%tab%';
  12. 12. Internal Filesort used EXPLAIN queries Identify usageof filesort in Extra Mariadb> SHOW STATUS LIKE 'sort%';
  13. 13. Handler variables Using Indexesisusually better. Rnd access vs Key access Mariadb> SHOW STATUS LIKE 'Handler%';
  14. 14. Schema design Normalization → Denormalization DataTypes(follow theABC) Indexes(assmall aspossible) PK (haveacopy in secondary indexes→ small) Summary tablesfor reporting/financeetc.
  15. 15. Data Types DataTypes A B C
  16. 16. Data Types DataTypes Apt (e.g. no numbersin VARCHAR) B C
  17. 17. Data Types DataTypes Apt (e.g. no numbersin VARCHAR) Brief (e.g. BIGINT → INT (SMALLNT)) C
  18. 18. Data Types DataTypes Apt (e.g. no numbersin VARCHAR) Brief (e.g. BIGINT → INT (SMALLNT)) Complete(noALTER TABLE in thefuture)
  19. 19. Server configuration best practices Global buffers innodb_buffer_pool_size key_buffer_size (only if MyISAM tablesareused) table_open_cache table_definition_cache
  20. 20. Server configuration best practices Global buffers innodb_buffer_pool_size 50%-80% of freemain memory key_buffer_size (only if MyISAM tablesareused) table_open_cache table_definition_cache open_files_limit (with Cluster Enterprise)
  21. 21. Server configuration best practices BehaveslikeAn In Memory Database: innodb_adaptive_hash_index=ON (default) → try turning it off
  22. 22. Server configuration best practices Encoding: utf8 slowsthingsdown 3-4 timesmorespaceon I/O
  23. 23. Server configuration best practices Encoding: utf8 slowsthingsdown 3-4 timesmorespaceon I/O
  24. 24. Thank you! training.mariadb.com jens@mariadb.com ● Get certified

×