SlideShare a Scribd company logo
1 of 10
Download to read offline
Top 10 MySQL 5.7
variables
Shiv Iyer
Safe Harbour Statement
This presentation is intended to outline our technology focus and research
interests of MinervaDB. It is intended for information purposes only, and
may not be incorporated into any contract. It is not a commitment to
deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The tools used, best practices, data ops.
checklists and all research guidance directions remains at the sole
discretion of MinervaDB .
Configure MySQL for performance, scalability and reliability
Best practices for configuring my.CNF :
● Change only one system variable at a time in my.cnf, This helps in estimating and quantifying the benefits of the
change .
● Never accept duplicate settings in my.cnf, We recommend using version control to track the system variable changes
in my.cnf and always retain the copy / backup of my.cnf for restore / recovery .
● Most of the system variables can be changed at runtime with SET GLOBAL, It really good because we can rollback if
the change is causing the new problem but never forget to note down the changes which you need to add in the
my.cnf before next MySQL restart (we often see this mistake happening) .
● Confirm MySQL system variables are added after [mysqld] in my.cnf .
● Never copy my.cf of another server presuming optimal performance, If you have simple queries in MySQL then there
is no need to increase sort_buffer_size even if you have 512 GB RAM .
● We seriously care about your MySQL reliability above performance so we always recommend setting
sync_binlog=1 (presuming binary logging enabled) and innodb_flush_log_at_trx_commit=1
MySQL 5.7 System Variables we
consider changing immediately
after successful installation ...
The following below are 4 system variables / my.cnf values I consider changing immediately
after successful MySQL installation for performance and reliability :
● innodb_buffer_pool_size - InnoDB buffer pool caches both data and indexes so always consider
setting this value between 50%-75% of available RAM, Does not need to be larger than the
database .
● innodb_flush_log_at_trx_commit - set this value to "1" (default) for maximum reliability and "0” or
"2" for less reliability and more performance (we don't recommend this setting)
● innodb_log_file_size - larger the value less checkpoint flush activity required in buffer pool (this
also makes crash recovery slower) so there will be less disk I/O and benefit in the performance . If
your application is write intensive you can set this value to "1 GB" (I don't prefer setting this value
too high !!)
● innodb_flush_method - You can set this value to "O_DIRECT" to avoid double buffering .
Advanced my.cnf configuration in MySQL 5.7
● innodb_io_capacity and innodb_io_capacity_max - consider setting these two system variables only if you have a
lots of writes all the time (it does not apply for reads / SELECTS) and use solid-state disks (SSD), We recommend
you to benchmark disk throughput (I use sysbench) before setting this value . If you have a server with 1 SSD we
recommend innodb_io_capacity "4000" and innodb_io_capacity_max "8000" .
● Innodb_autoinc_lock_mode - Setting innodb_autoinc_lock_mode "2" (interleaved mode) improve the performance
of MySQL by not depending on table-level AUTO-INC lock, This makes multi-row insert statements with
auto-increment primary key more optimal, This requires binlog_format=ROW or MIXED (and ROW is the default in
MySQL 5.7). There may be gaps in the auto-increment values generated by "bulk inserts" , but only if there are
concurrently executing "INSERT - like" statements
MySQL 5.7 has much better default values
● innodb_buffer_pool_dump_at_shutdown and innodb_buffer_pool_load_startup are enabled by default - This
records the pages cached in the InnoDB buffer pool when MySQL server is shutdown and shorten the warm-up
process at the next restart .
● Innodb_file_per_table = ON (DEFAULT)
● Innodb_stats_on_metadata = OFF (DEFAULT) , so statistics for queries like SHOW TABLE STATUS OR
INFORMATION_SCHEMA.TABLES are not updated,This improves performance and stability of execution plans for
queries that involve InnoDB tables .
● QUERY_CACHE_TYPE = 0 (DEFAULT) , so it does not acquire the query cache mutex at all and there is reduced
overhead in query execution .
We use slow_query_log and pt-query-digest for tracing MySQL
We can dynamically enable slow_query_log and long_query_time (I usually log queries taking more than 1 sec. to execute)
for tracing MySQL performance. The pt-query_digest (Percona Toolkit) from Percona makes aggregation of slow_query
_log better
pt-query_digest usage :
pt-query-digest slow.log
Contact Shiv Iyer
Email - shiv@minervadb.com
Skype - shiv@minervadb.com
Google Hangouts - shiv@minervadb.com
Twitter - https://twitter.com/thewebscaledba
Facebook - https://www.facebook.com/TheWebScaleDBA
LinkedIn - https://www.linkedin.com/in/thewebscaledba/
Thank You

More Related Content

What's hot

What's hot (7)

MySQL Best Practices - OTN
MySQL Best Practices - OTNMySQL Best Practices - OTN
MySQL Best Practices - OTN
 
ProxySQL para mysql
ProxySQL para mysqlProxySQL para mysql
ProxySQL para mysql
 
Database mirroring setup
Database mirroring setupDatabase mirroring setup
Database mirroring setup
 
SQL Database Mirroring setup
SQL Database Mirroring setupSQL Database Mirroring setup
SQL Database Mirroring setup
 
MySQL For Oracle Developers
MySQL For Oracle DevelopersMySQL For Oracle Developers
MySQL For Oracle Developers
 
MySQL Latest News
MySQL Latest NewsMySQL Latest News
MySQL Latest News
 
Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs
 

Similar to Top 10 my sql 5.7 variables we consider changing immediately after successful installation

MySQL Performance Best Practices
MySQL Performance Best PracticesMySQL Performance Best Practices
MySQL Performance Best PracticesOlivier DASINI
 
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 57-upcoming-changes
Mysql 57-upcoming-changesMysql 57-upcoming-changes
Mysql 57-upcoming-changesMorgan Tocker
 
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
 
Percona 服务器与 XtraDB 存储引擎
Percona 服务器与 XtraDB 存储引擎Percona 服务器与 XtraDB 存储引擎
Percona 服务器与 XtraDB 存储引擎YUCHENG HU
 
Inno db datafiles backup and retore
Inno db datafiles backup and retoreInno db datafiles backup and retore
Inno db datafiles backup and retoreVasudeva Rao
 
MySQL 5.5&5.6 new features summary
MySQL 5.5&5.6 new features summaryMySQL 5.5&5.6 new features summary
MySQL 5.5&5.6 new features summaryLouis liu
 
01 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv101 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv1Ivan Ma
 
MySQL Performance - Best practices
MySQL Performance - Best practices MySQL Performance - Best practices
MySQL Performance - Best practices Ted Wennmark
 
Upgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeUpgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeOlivier DASINI
 
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
 
Faster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBFaster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBMariaDB plc
 
MySQL5.7 Innodb_enhance_parti_20160317
MySQL5.7 Innodb_enhance_parti_20160317MySQL5.7 Innodb_enhance_parti_20160317
MySQL5.7 Innodb_enhance_parti_20160317Saewoong Lee
 
MySQL performance webinar
MySQL performance webinarMySQL performance webinar
MySQL performance webinarAbel Flórez
 
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015Dave Stokes
 
Evolution of DBA in the Cloud Era
 Evolution of DBA in the Cloud Era Evolution of DBA in the Cloud Era
Evolution of DBA in the Cloud EraMydbops
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014Ryusuke Kajiyama
 
MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014) MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014) Frazer Clement
 
Webinar slides: MySQL Query Tuning Trilogy: Working with optimizer and SQL tu...
Webinar slides: MySQL Query Tuning Trilogy: Working with optimizer and SQL tu...Webinar slides: MySQL Query Tuning Trilogy: Working with optimizer and SQL tu...
Webinar slides: MySQL Query Tuning Trilogy: Working with optimizer and SQL tu...Severalnines
 
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...Severalnines
 

Similar to Top 10 my sql 5.7 variables we consider changing immediately after successful installation (20)

MySQL Performance Best Practices
MySQL Performance Best PracticesMySQL Performance Best Practices
MySQL Performance Best Practices
 
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
 
Mysql 57-upcoming-changes
Mysql 57-upcoming-changesMysql 57-upcoming-changes
Mysql 57-upcoming-changes
 
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
 
Percona 服务器与 XtraDB 存储引擎
Percona 服务器与 XtraDB 存储引擎Percona 服务器与 XtraDB 存储引擎
Percona 服务器与 XtraDB 存储引擎
 
Inno db datafiles backup and retore
Inno db datafiles backup and retoreInno db datafiles backup and retore
Inno db datafiles backup and retore
 
MySQL 5.5&5.6 new features summary
MySQL 5.5&5.6 new features summaryMySQL 5.5&5.6 new features summary
MySQL 5.5&5.6 new features summary
 
01 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv101 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv1
 
MySQL Performance - Best practices
MySQL Performance - Best practices MySQL Performance - Best practices
MySQL Performance - Best practices
 
Upgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeUpgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtime
 
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
 
Faster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBFaster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDB
 
MySQL5.7 Innodb_enhance_parti_20160317
MySQL5.7 Innodb_enhance_parti_20160317MySQL5.7 Innodb_enhance_parti_20160317
MySQL5.7 Innodb_enhance_parti_20160317
 
MySQL performance webinar
MySQL performance webinarMySQL performance webinar
MySQL performance webinar
 
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015
 
Evolution of DBA in the Cloud Era
 Evolution of DBA in the Cloud Era Evolution of DBA in the Cloud Era
Evolution of DBA in the Cloud Era
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
 
MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014) MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014)
 
Webinar slides: MySQL Query Tuning Trilogy: Working with optimizer and SQL tu...
Webinar slides: MySQL Query Tuning Trilogy: Working with optimizer and SQL tu...Webinar slides: MySQL Query Tuning Trilogy: Working with optimizer and SQL tu...
Webinar slides: MySQL Query Tuning Trilogy: Working with optimizer and SQL tu...
 
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
Webinar slides: The Holy Grail Webinar: Become a MySQL DBA - Database Perform...
 

More from MinervaDB

MinervaDB Corporate Presentation
MinervaDB Corporate Presentation MinervaDB Corporate Presentation
MinervaDB Corporate Presentation MinervaDB
 
PostgreSQL Consulting and Support
PostgreSQL Consulting and SupportPostgreSQL Consulting and Support
PostgreSQL Consulting and SupportMinervaDB
 
MinervaDB corporate profile
MinervaDB corporate profileMinervaDB corporate profile
MinervaDB corporate profileMinervaDB
 
MinervaDB Remote DBA Services
MinervaDB Remote DBA ServicesMinervaDB Remote DBA Services
MinervaDB Remote DBA ServicesMinervaDB
 
MinervaDB enterprise-class 24*7 support
MinervaDB enterprise-class 24*7 supportMinervaDB enterprise-class 24*7 support
MinervaDB enterprise-class 24*7 supportMinervaDB
 
MinervaDB Corporate Presentation
MinervaDB Corporate Presentation MinervaDB Corporate Presentation
MinervaDB Corporate Presentation MinervaDB
 
Minerva db corporate flyer
Minerva db corporate flyerMinerva db corporate flyer
Minerva db corporate flyerMinervaDB
 

More from MinervaDB (7)

MinervaDB Corporate Presentation
MinervaDB Corporate Presentation MinervaDB Corporate Presentation
MinervaDB Corporate Presentation
 
PostgreSQL Consulting and Support
PostgreSQL Consulting and SupportPostgreSQL Consulting and Support
PostgreSQL Consulting and Support
 
MinervaDB corporate profile
MinervaDB corporate profileMinervaDB corporate profile
MinervaDB corporate profile
 
MinervaDB Remote DBA Services
MinervaDB Remote DBA ServicesMinervaDB Remote DBA Services
MinervaDB Remote DBA Services
 
MinervaDB enterprise-class 24*7 support
MinervaDB enterprise-class 24*7 supportMinervaDB enterprise-class 24*7 support
MinervaDB enterprise-class 24*7 support
 
MinervaDB Corporate Presentation
MinervaDB Corporate Presentation MinervaDB Corporate Presentation
MinervaDB Corporate Presentation
 
Minerva db corporate flyer
Minerva db corporate flyerMinerva db corporate flyer
Minerva db corporate flyer
 

Recently uploaded

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 

Recently uploaded (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 

Top 10 my sql 5.7 variables we consider changing immediately after successful installation

  • 1. Top 10 MySQL 5.7 variables Shiv Iyer
  • 2. Safe Harbour Statement This presentation is intended to outline our technology focus and research interests of MinervaDB. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The tools used, best practices, data ops. checklists and all research guidance directions remains at the sole discretion of MinervaDB .
  • 3. Configure MySQL for performance, scalability and reliability Best practices for configuring my.CNF : ● Change only one system variable at a time in my.cnf, This helps in estimating and quantifying the benefits of the change . ● Never accept duplicate settings in my.cnf, We recommend using version control to track the system variable changes in my.cnf and always retain the copy / backup of my.cnf for restore / recovery . ● Most of the system variables can be changed at runtime with SET GLOBAL, It really good because we can rollback if the change is causing the new problem but never forget to note down the changes which you need to add in the my.cnf before next MySQL restart (we often see this mistake happening) . ● Confirm MySQL system variables are added after [mysqld] in my.cnf . ● Never copy my.cf of another server presuming optimal performance, If you have simple queries in MySQL then there is no need to increase sort_buffer_size even if you have 512 GB RAM . ● We seriously care about your MySQL reliability above performance so we always recommend setting sync_binlog=1 (presuming binary logging enabled) and innodb_flush_log_at_trx_commit=1
  • 4. MySQL 5.7 System Variables we consider changing immediately after successful installation ...
  • 5. The following below are 4 system variables / my.cnf values I consider changing immediately after successful MySQL installation for performance and reliability : ● innodb_buffer_pool_size - InnoDB buffer pool caches both data and indexes so always consider setting this value between 50%-75% of available RAM, Does not need to be larger than the database . ● innodb_flush_log_at_trx_commit - set this value to "1" (default) for maximum reliability and "0” or "2" for less reliability and more performance (we don't recommend this setting) ● innodb_log_file_size - larger the value less checkpoint flush activity required in buffer pool (this also makes crash recovery slower) so there will be less disk I/O and benefit in the performance . If your application is write intensive you can set this value to "1 GB" (I don't prefer setting this value too high !!) ● innodb_flush_method - You can set this value to "O_DIRECT" to avoid double buffering .
  • 6. Advanced my.cnf configuration in MySQL 5.7 ● innodb_io_capacity and innodb_io_capacity_max - consider setting these two system variables only if you have a lots of writes all the time (it does not apply for reads / SELECTS) and use solid-state disks (SSD), We recommend you to benchmark disk throughput (I use sysbench) before setting this value . If you have a server with 1 SSD we recommend innodb_io_capacity "4000" and innodb_io_capacity_max "8000" . ● Innodb_autoinc_lock_mode - Setting innodb_autoinc_lock_mode "2" (interleaved mode) improve the performance of MySQL by not depending on table-level AUTO-INC lock, This makes multi-row insert statements with auto-increment primary key more optimal, This requires binlog_format=ROW or MIXED (and ROW is the default in MySQL 5.7). There may be gaps in the auto-increment values generated by "bulk inserts" , but only if there are concurrently executing "INSERT - like" statements
  • 7. MySQL 5.7 has much better default values ● innodb_buffer_pool_dump_at_shutdown and innodb_buffer_pool_load_startup are enabled by default - This records the pages cached in the InnoDB buffer pool when MySQL server is shutdown and shorten the warm-up process at the next restart . ● Innodb_file_per_table = ON (DEFAULT) ● Innodb_stats_on_metadata = OFF (DEFAULT) , so statistics for queries like SHOW TABLE STATUS OR INFORMATION_SCHEMA.TABLES are not updated,This improves performance and stability of execution plans for queries that involve InnoDB tables . ● QUERY_CACHE_TYPE = 0 (DEFAULT) , so it does not acquire the query cache mutex at all and there is reduced overhead in query execution .
  • 8. We use slow_query_log and pt-query-digest for tracing MySQL We can dynamically enable slow_query_log and long_query_time (I usually log queries taking more than 1 sec. to execute) for tracing MySQL performance. The pt-query_digest (Percona Toolkit) from Percona makes aggregation of slow_query _log better pt-query_digest usage : pt-query-digest slow.log
  • 9. Contact Shiv Iyer Email - shiv@minervadb.com Skype - shiv@minervadb.com Google Hangouts - shiv@minervadb.com Twitter - https://twitter.com/thewebscaledba Facebook - https://www.facebook.com/TheWebScaleDBA LinkedIn - https://www.linkedin.com/in/thewebscaledba/