Changeset 21
- Timestamp:
- 12/01/07 20:31:15 (1 year ago)
- Files:
-
- mysqltuner.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
mysqltuner.pl
r20 r21 1 1 #!/usr/bin/perl -w 2 # mysqltuner.pl - High Performance MySQL Tuning Script 2 # mysqltuner.pl - Revision 20071201 3 # High Performance MySQL Tuning Script 3 4 # Copyright (C) 2006-2007 Major Hayden - major@mhtx.net 4 5 # 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/ 11 8 # 12 9 # This program is free software: you can redistribute it and/or modify … … 22 19 # You should have received a copy of the GNU General Public License 23 20 # 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 # 24 31 25 32 use strict; … … 51 58 " MySQL High Performance Tuning Script\n". 52 59 " 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". 54 61 " Important Usage Guidelines:\n". 55 62 " To run the script with the default options, run the script without arguments\n". … … 301 308 $mycalc{'pct_keys_from_mem'} = sprintf("%.1f",(100 - (($mystat{'Key_reads'} / $mystat{'Key_read_requests'}) * 100))); 302 309 } 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"; } 309 312 chomp($mycalc{'total_myisam_indexes'}); 310 313 … … 592 595 # BEGIN 'MAIN' 593 596 # --------------------------------------------------------------------------- 594 print " MySQL High-Performance Tun er - Major Hayden <major.hayden\@rackspace.com>\n".595 " Bug reports, feature requests, and downloads at mysqltuner.com\n".597 print " MySQL High-Performance Tuning Script - Major Hayden <major\@mhtx.net>\n". 598 " Bug reports, feature requests, and downloads at http://mysqltuner.com/\n". 596 599 " Run with '--help' for additional options and output filtering\n"; 597 600 os_setup; # Set up some OS variables