Great tools for tuning mysql server variables.

My favourite scripts for tuning mysql server variables are:

1, tuning-primer.sh

This script takes information from “SHOW STATUS LIKE…”
and “SHOW VARIABLES LIKE…” then attempts to produce sane recommendations
for tuning server variables. It is compatible with all versions of MySQL 3.23 – 5.1.

How to use:

a, download

b, edit tunnig-primer.sh via your favourite text editor and set path to your socket

at line 38

c, run with your favourite arguments (without arguments is the best choice):

#########################################################################
#                                                                       #
# Little known feature: 1st argument is execution mode                  #
#                                                                       #
#       Usage: ./tuning-primer.sh [ mode ]                              #
#                                                                       #
#       Available Modes:                                                #
#               all :           perform all checks (default)            #
#               prompt :        prompt for login credintials and socket #
#                               and execution mode                      #
#               mem, memory :   run checks for tunable options which    #
#                               effect memory usage                     #
#               disk, file :    run checks for options which effect     #
#                               i/o performance or file handle limits   #
#               innodb :        run InnoDB checks /* to be improved */  #
#               misc :          run checks for that don’t categorise    #
#                               well Slow Queries, Binary logs,         #
#                               Used Connections and Worker Threads     #
########################################################################

2, mysqltuner.pl

is similar like  tuning-primer.sh.

options for mysqltuner are:

Connection and Authentication
–host <hostname>    Connect to a remote host to perform tests (default: localhost)
–port <port>        Port to use for connection (default: 3306)
–user <username>    Username to use for authentication
–pass <password>    Password to use for authentication

Performance and Reporting Options
–skipsize           Don’t enumerate tables and their types/sizes (default: on)
(Recommended for servers with many tables)
–checkversion       Check for updates to MySQLTuner (default: don’t check)
–forcemem <size>    Amount of RAM installed in megabytes
–forceswap <size>   Amount of swap memory configured in megabytes

Output Options:
–nogood             Remove OK responses
–nobad              Remove negative/suggestion responses
–noinfo             Remove informational responses
–nocolor            Don’t print output in color


Both are great MySQL High Performance Tuning Scripts.

I prefer tuning-primer.sh, because is written in bash.


Download links:

tuning-primer.sh

mysqltuner.pl


Leave a Reply