Need help with tuning-primer.sh?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

BMDan
161 Stars 62 Forks GNU General Public License v2.0 39 Commits 2 Opened issues

Description

MySQL Tuning-Primer.sh, updated and improved

Services available

!
?

Need anything else?

Contributors list

# 300,523
timezon...
Python
Shell
python3
25 commits
# 354,110
JavaScr...
CSS
Shell
11 commits
# 214,436
LLVM
Racket
Svelte
Elixir
1 commit

MySQL Tuning-Primer.sh

How to use

Download and run tuning-primer.sh.

If you don't like downloading anything and you do like living dangerously, you could instead run it with something like this¹:

curl -L https://raw.githubusercontent.com/BMDan/tuning-primer.sh/master/tuning-primer.sh | bash

About this repository

This is the script originally developed by Matthew Montgomery, and previously hosted at Day32.com. This version has been updated and improved for newer versions of MySQL, Percona Server, and MariaDB. This Github repository was created with Matthew's permission by Dan Reif, but Matthew has no control over it; in other words, please don't bother Matthew with questions about this repository!

This repository will be used to handle ongoing development and bugfixes for this script. Please file bug reports here. Pull requests are welcomed.

About this script

This script takes information from

SHOW STATUS LIKE...
and
SHOW VARIABLES LIKE...
to produce sane recomendations for tuning server variables.

It (attempts to be!) compatible with all versions of MySQL 3.23 and higher (including 5.x), as well as MariaDB, and Percona Server for MySQL.²

Currently it handles recomendations for the following:

  • Slow Query Log
  • Max Connections
  • Worker Threads
  • Key Buffer [MyISAM only]
  • Query Cache
  • Sort Buffer
  • Joins
  • Temp Tables
  • Table (Open & Definition) Cache
  • Table Locking
  • Table Scans (
    read_buffer
    ) [MyISAM only]
  • InnoDB Status

Recent Changes

  • Updated to (at least mostly) support MySQL 5.7+ and MariaDB
  • A lot of cleanup of the underlying code
  • Better handling of terminals and redirection (got rid of the hardcoded color sequences, switched to proper terminfo)
  • Fixed the old
    ./tuning-primer.sh: line 402: export: `2097152': not a valid identifier
    bug

More, as always, in the changelog.


Legal Stuff

Use of this software is governed by its LICENSE, regardless of how it is accessed or by whom it is used. Follow the license, dammit.

Some of the terms used in this script or in the documentation surrounding it may be copyrighted, trademarked, or otherwise owned by external entities including but not limited to Oracle, Percona, MariaDB Corporation Ab, and others. These terms are used solely for identification of products, and the interoperability of this script with these or any other products, even if explicitly claimed, is nonetheless not guaranteed by any author. No affiliation with or licensing from these entities is stated nor implied. Anyone who says otherwise is itchin' for a fight.


Footnotes

¹: Running it without downloading it and reading it first is a truly awful choice, and I arguably shouldn't put this command here. Then again, if you are the sort of person who even wonders how to run a script with root access to your database by piping it into Bash, you're probably the sort of person I can't convince not to do so. At least these instructions are ever-so-slightly safer than what'll appear on some Stack Overflow if I didn't put this here.

²: ... and anything else sufficiently MySQLish to export the status variables it uses to run.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.