Changeset 19
- Timestamp:
- 10/16/07 01:45:09 (1 year ago)
- Files:
-
- mysqltuner.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
mysqltuner.pl
r18 r19 69 69 $good = "[\e[00;32mOK\e[00m]"; 70 70 $bad = "[\e[00;31m!!\e[00m]"; 71 $info = "[\e[00;34m --\e[00m]";71 $info = "[\e[00;34m**\e[00m]"; 72 72 } else { 73 73 $good = "[OK]"; … … 392 392 393 393 # Memory usage 394 infoprint "Total buffers per thread: ".hr_bytes($mycalc{'per_thread_buffers'})."\n"; 395 infoprint "Total global buffers: ".hr_bytes($mycalc{'server_buffers'})."\n"; 394 396 if ($mycalc{'pct_physical_memory'} > 85) { 395 397 badprint "Maximum possible memory usage: ".hr_bytes($mycalc{'total_possible_used_memory'})." ($mycalc{'pct_physical_memory'}% of installed RAM)\n"; … … 426 428 badprint "None of your MyISAM tables are indexed - add indexes immediately\n"; 427 429 } else { 428 if ($myvar{'key_buffer_size'} < $mycalc{'total_myisam_indexes'} ) {430 if ($myvar{'key_buffer_size'} < $mycalc{'total_myisam_indexes'} && $mycalc{'pct_keys_from_mem'} < 95) { 429 431 badprint "Key buffer size / total MyISAM indexes: ".hr_bytes($myvar{'key_buffer_size'})."/".hr_bytes($mycalc{'total_myisam_indexes'})."\n"; 430 432 push(@incvars,"key_buffer_size (> ".hr_bytes($mycalc{'total_myisam_indexes'}).")"); … … 443 445 } 444 446 } 445 if ($mysqlvermajor > 3 && $myvar{'max_seeks_for_key'} > 1000) { push(@decvars,"max_seeks_for_key (<= 1000)"); }446 447 447 448 # Query cache … … 494 495 # Temporary tables 495 496 if ($mystat{'Created_tmp_tables'} > 0) { 496 if ($mycalc{'pct_temp_disk'} > 25 ) {497 if ($mycalc{'pct_temp_disk'} > 25 && $mycalc{'max_tmp_table_size'} < 256) { 497 498 badprint "Temporary tables created on disk: $mycalc{'pct_temp_disk'}%\n"; 498 499 push(@incvars,"tmp_table_size (> ".hr_bytes_rnd($myvar{'tmp_table_size'}).")"); 499 500 push(@incvars,"max_heap_table_size (> ".hr_bytes_rnd($myvar{'max_heap_table_size'}).")"); 500 501 push(@generalrec,"Be sure that tmp_table_size/max_heap_table_size are equal"); 502 push(@generalrec,"Reduce your SELECT DISTINCT queries without LIMIT clauses"); 503 } elsif ($mycalc{'pct_temp_disk'} > 25 && $mycalc{'max_tmp_table_size'} >= 256) { 504 badprint "Temporary tables created on disk: $mycalc{'pct_temp_disk'}%\n"; 505 push(@generalrec,"Temporary table size is already large - reduce result set size"); 501 506 push(@generalrec,"Reduce your SELECT DISTINCT queries without LIMIT clauses"); 502 507 } else { … … 554 559 push(@generalrec,"Enable concurrent_insert by setting it to 1"); 555 560 } 556 if ($mycalc{'pct_aborted_connections'} > 0) {557 badprint "Connections aborted: ".$mycalc{'pct_aborted_connections'}." \n";561 if ($mycalc{'pct_aborted_connections'} > 5) { 562 badprint "Connections aborted: ".$mycalc{'pct_aborted_connections'}."%\n"; 558 563 push(@generalrec,"Your applications are not closing MySQL connections properly"); 559 564 }