Assembla home | Assembla project page
 

Changeset 21

Show
Ignore:
Timestamp:
12/01/07 20:31:15 (1 year ago)
Author:
major
Message:

* Changed indexing calculations so that all tables are not opened in MySQL 5 (thanks Jon!)
* Adjusted some of the commented lines at the top of the script

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mysqltuner.pl

    r20 r21  
    11#!/usr/bin/perl -w 
    2 # mysqltuner.pl - High Performance MySQL Tuning Script 
     2# mysqltuner.pl - Revision 20071201 
     3# High Performance MySQL Tuning Script 
    34# Copyright (C) 2006-2007 Major Hayden - major@mhtx.net 
    45# 
    5 # Inspired by Matthew Montgomery's tuning-primer.sh script: 
    6 # http://forge.mysql.com/projects/view.php?id=44 
    7 
    8 # Other Contributors: 
    9 #       Paul Kehrer 
    10 #   Dave Burgess 
     6# For the latest updates, please visit http://mysqltuner.com 
     7# Subversion repository available at http://tools.assembla.com/svn/mysqltuner/ 
    118# 
    129# This program is free software: you can redistribute it and/or modify 
     
    2219# You should have received a copy of the GNU General Public License 
    2320# along with this program.  If not, see <http://www.gnu.org/licenses/>. 
     21# 
     22# This project would not be possible without help from: 
     23#   Matthew Montgomery 
     24#   Paul Kehrer 
     25#   Dave Burgess 
     26#   Jonathan Hinds 
     27# 
     28# Inspired by Matthew Montgomery's tuning-primer.sh script: 
     29# http://forge.mysql.com/projects/view.php?id=44 
     30# 
    2431 
    2532use strict; 
     
    5158        "    MySQL High Performance Tuning Script\n". 
    5259        "    Bug reports, feature requests, and downloads at http://mysqltuner.com/\n". 
    53         "    Maintained by Major Hayden (major.hayden\@rackspace.com)\n\n". 
     60        "    Maintained by Major Hayden (major\@mhtx.net)\n\n". 
    5461        "    Important Usage Guidelines:\n". 
    5562        "       To run the script with the default options, run the script without arguments\n". 
     
    301308        $mycalc{'pct_keys_from_mem'} = sprintf("%.1f",(100 - (($mystat{'Key_reads'} / $mystat{'Key_read_requests'}) * 100))); 
    302309    } 
    303     if ($mysqlvermajor < 5) { 
    304         $mycalc{'total_myisam_indexes'} = `find $myvar{'datadir'} -name '*.MYI' 2>&1 | xargs du $duflags '{}' 2>&1 | awk '{ s += \$1 } END { print s }'`; 
    305         if ($mycalc{'total_myisam_indexes'} =~ /^0\n$/) { $mycalc{'total_myisam_indexes'} = "fail"; } 
    306     } else { 
    307         $mycalc{'total_myisam_indexes'} = `mysql $mysqllogin -Bse "/*!50000 SELECT SUM(INDEX_LENGTH) from information_schema.TABLES where ENGINE='MyISAM' */"`; 
    308     } 
     310    $mycalc{'total_myisam_indexes'} = `find $myvar{'datadir'} -name '*.MYI' 2>&1 | xargs du $duflags '{}' 2>&1 | awk '{ s += \$1 } END { print s }'`; 
     311    if ($mycalc{'total_myisam_indexes'} =~ /^0\n$/) { $mycalc{'total_myisam_indexes'} = "fail"; } 
    309312    chomp($mycalc{'total_myisam_indexes'}); 
    310313     
     
    592595# BEGIN 'MAIN' 
    593596# --------------------------------------------------------------------------- 
    594 print   "     MySQL High-Performance Tuner - Major Hayden <major.hayden\@rackspace.com>\n". 
    595         "     Bug reports, feature requests, and downloads at mysqltuner.com\n". 
     597print   "     MySQL High-Performance Tuning Script - Major Hayden <major\@mhtx.net>\n". 
     598        "     Bug reports, feature requests, and downloads at http://mysqltuner.com/\n". 
    596599        "     Run with '--help' for additional options and output filtering\n"; 
    597600os_setup;                           # Set up some OS variables