Assembla home | Assembla project page
 

Changeset 19

Show
Ignore:
Timestamp:
10/16/07 01:45:09 (1 year ago)
Author:
major
Message:

* Adjusted infoprint to use asterisks (cosmetic)
* Per-thread/global buffer counts are now displayed
* Key buffer increases are only recommended if the buffer is smaller than total indexes and key buffer hit rate is < 95%
* Dropped max_seeks_for_key checks
* Temporary table size increases are not recommended over 256M
* Aborted connection calculation and recommendation adjustments

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mysqltuner.pl

    r18 r19  
    6969    $good = "[\e[00;32mOK\e[00m]"; 
    7070    $bad = "[\e[00;31m!!\e[00m]"; 
    71     $info = "[\e[00;34m--\e[00m]"; 
     71    $info = "[\e[00;34m**\e[00m]"; 
    7272} else { 
    7373    $good = "[OK]"; 
     
    392392 
    393393    # 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"; 
    394396    if ($mycalc{'pct_physical_memory'} > 85) { 
    395397        badprint "Maximum possible memory usage: ".hr_bytes($mycalc{'total_possible_used_memory'})." ($mycalc{'pct_physical_memory'}% of installed RAM)\n"; 
     
    426428        badprint "None of your MyISAM tables are indexed - add indexes immediately\n"; 
    427429    } 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) { 
    429431            badprint "Key buffer size / total MyISAM indexes: ".hr_bytes($myvar{'key_buffer_size'})."/".hr_bytes($mycalc{'total_myisam_indexes'})."\n"; 
    430432            push(@incvars,"key_buffer_size (> ".hr_bytes($mycalc{'total_myisam_indexes'}).")"); 
     
    443445        } 
    444446    } 
    445     if ($mysqlvermajor > 3 && $myvar{'max_seeks_for_key'} > 1000) { push(@decvars,"max_seeks_for_key (<= 1000)"); } 
    446447     
    447448    # Query cache 
     
    494495    # Temporary tables 
    495496    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) { 
    497498            badprint "Temporary tables created on disk: $mycalc{'pct_temp_disk'}%\n"; 
    498499            push(@incvars,"tmp_table_size (> ".hr_bytes_rnd($myvar{'tmp_table_size'}).")"); 
    499500            push(@incvars,"max_heap_table_size (> ".hr_bytes_rnd($myvar{'max_heap_table_size'}).")"); 
    500501            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"); 
    501506            push(@generalrec,"Reduce your SELECT DISTINCT queries without LIMIT clauses"); 
    502507        } else { 
     
    554559        push(@generalrec,"Enable concurrent_insert by setting it to 1"); 
    555560    } 
    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"; 
    558563                push(@generalrec,"Your applications are not closing MySQL connections properly"); 
    559564        }