Merge pull request #343 from pes-soft/innodb-logsize-suggestion-doc

Add recommendation for innodb log file changes and some extra information
This commit is contained in:
Jean-Marie Renouard 2017-09-11 09:26:01 +02:00 committed by GitHub
commit e5f3736a64
2 changed files with 33 additions and 29 deletions

View file

@ -72,7 +72,7 @@
## MySQLTuner system checks ## MySQLTuner system checks
* 32-bit w/>2GB RAM check * 32-bit w/>2GB RAM check
* Check number of opened ports (warning if more than 9 ports opened) * Check number of opened ports (warning if more than 9 ports opened)
* Check 80, 8080, 443 and 8443 ports if warning are raised if there are opened * Check 80, 8080, 443 and 8443 ports if warning are raised if there are opened
* Check if some banned ports are not opened (option --bannedports separated by comma) * Check if some banned ports are not opened (option --bannedports separated by comma)
* Check if non kernel and user process except mysqld are not using more than 15% of total physical memory) * Check if non kernel and user process except mysqld are not using more than 15% of total physical memory)
* Check vm.swapiness * Check vm.swapiness
@ -103,7 +103,7 @@
* Users w/o host restriction * Users w/o host restriction
* Weak password check (possibly using cracklib later?) * Weak password check (possibly using cracklib later?)
* Using basic_passwords.txt as password database * Using basic_passwords.txt as password database
* Password list checks can be avoid (option: --skippassword) * Password list checks can be avoid (option: --skippassword)
## MySQLTuner CVE vulnerabilities detection ## MySQLTuner CVE vulnerabilities detection
@ -131,7 +131,7 @@
* Per index information * Per index information
* Index Cardinality * Index Cardinality
* Index Selectivity * Index Selectivity
* Misc information about index definition * Misc information about index definition
* Misc information about index size * Misc information about index size
## MySQLTuner Connections information ## MySQLTuner Connections information
@ -180,7 +180,7 @@
* Query Cache DISABLED, ALL REQUEST or ON DEMAND * Query Cache DISABLED, ALL REQUEST or ON DEMAND
* Query Cache Size * Query Cache Size
* Query cache hit ratio (cache efficienty) * Query cache hit ratio (cache efficienty)
## MySQLTuner memory checks ## MySQLTuner memory checks
* Get total RAM/swap * Get total RAM/swap
@ -209,8 +209,10 @@
* MySQL needs 1 instanes per 1Go of Buffer Pool * MySQL needs 1 instanes per 1Go of Buffer Pool
* innodb_buffer_pool instances = round(innodb_buffer_pool_size / 1Go) * innodb_buffer_pool instances = round(innodb_buffer_pool_size / 1Go)
* innodb_buffer_pool instances must be equals or lower than 64 * innodb_buffer_pool instances must be equals or lower than 64
* InnoDB Buffer Pool Usage * InnoDB Buffer Pool Usage
* If more than 20% of InnoDB buffer pool is not used, MySQLTuner raise an alert. * If more than 20% of InnoDB buffer pool is not used, MySQLTuner raise an alert.
* InnoDB Buffer Pool Log Size
* InnoDB total log file size should be 25% of innodb_buffer_pool_size
* InnoDB Read effiency * InnoDB Read effiency
* Ratio of read without locks * Ratio of read without locks
* InnoDB Write effiency * InnoDB Write effiency
@ -225,7 +227,7 @@
* Is Aria indexes size is greater than page cache size ? * Is Aria indexes size is greater than page cache size ?
* Page cache read hit ratio (>95%) * Page cache read hit ratio (>95%)
* Page cache write hit ratio (>95%) * Page cache write hit ratio (>95%)
## MySQLTuner MYISAM information ## MySQLTuner MYISAM information
@ -264,13 +266,13 @@
## MySQLTuner TokuDB information ## MySQLTuner TokuDB information
* tokudb_cache_size * tokudb_cache_size
* tokudb_directio * tokudb_directio
* tokudb_empty_scan * tokudb_empty_scan
* tokudb_read_block_size * tokudb_read_block_size
* tokudb_commit_sync * tokudb_commit_sync
* tokudb_checkpointing_period * tokudb_checkpointing_period
* tokudb_block_size * tokudb_block_size
* tokudb_cleaner_iterations * tokudb_cleaner_iterations
* tokudb_fanout * tokudb_fanout
@ -289,7 +291,7 @@
## MySQLTuner RocksDb information ## MySQLTuner RocksDb information
* Nothing for the moment * Nothing for the moment
## MySQLTuner Thread pool information ## MySQLTuner Thread pool information
* thread_pool_size between 16 to 36 for Innodb usage * thread_pool_size between 16 to 36 for Innodb usage
@ -352,9 +354,9 @@
* Event per wait total latency * Event per wait total latency
* Event per wait read latency * Event per wait read latency
* Event per wait write latency * Event per wait write latency
* TOP 15 most read indexes * TOP 15 most read indexes
* TOP 15 most modified indexes * TOP 15 most modified indexes
* TOP 15 high select latency index * TOP 15 high select latency index
* TOP 15 high insert latency index * TOP 15 high insert latency index
* TOP 15 high update latency index * TOP 15 high update latency index
* TOP 15 high delete latency index * TOP 15 high delete latency index
@ -383,7 +385,7 @@
* TOP 15 merge queries with sort * TOP 15 merge queries with sort
* TOP 15 average sort merges queries with sort * TOP 15 average sort merges queries with sort
* TOP 15 scans queries with sort * TOP 15 scans queries with sort
* TOP 15 range queries with sort * TOP 15 range queries with sort
* Top 20 queries with temp table * Top 20 queries with temp table
* Last 50 queries with temp table * Last 50 queries with temp table
* TOP 15 total latency queries with temp table * TOP 15 total latency queries with temp table
@ -393,4 +395,4 @@
* TOP 15 class events by total latency * TOP 15 class events by total latency
* TOP 30 events by total latency * TOP 30 events by total latency
* TOP 15 class events by max latency * TOP 15 class events by max latency
* TOP 30 events by max latency * TOP 30 events by max latency

View file

@ -2645,7 +2645,7 @@ sub mysql_stats {
if ( defined $myvar{'query_cache_type'} ) { if ( defined $myvar{'query_cache_type'} ) {
infoprint "Query Cache Buffers"; infoprint "Query Cache Buffers";
infoprint " +-- Query Cache: " infoprint " +-- Query Cache: "
. $myvar{'query_cache_type'} . " - " . $myvar{'query_cache_type'} . " - "
. ( . (
$myvar{'query_cache_type'} eq 0 | $myvar{'query_cache_type'} eq 0 |
@ -5382,7 +5382,7 @@ sub mysql_innodb {
. $myvar{'innodb_thread_concurrency'}; . $myvar{'innodb_thread_concurrency'};
} }
# InnoDB Buffer Pull Size # InnoDB Buffer Pool Size
if ( $myvar{'innodb_file_per_table'} eq "ON" ) { if ( $myvar{'innodb_file_per_table'} eq "ON" ) {
goodprint "InnoDB File per table is activated"; goodprint "InnoDB File per table is activated";
} }
@ -5391,7 +5391,7 @@ sub mysql_innodb {
push( @adjvars, "innodb_file_per_table=ON" ); push( @adjvars, "innodb_file_per_table=ON" );
} }
# InnoDB Buffer Pull Size # InnoDB Buffer Pool Size
if ( $myvar{'innodb_buffer_pool_size'} > $enginestats{'InnoDB'} ) { if ( $myvar{'innodb_buffer_pool_size'} > $enginestats{'InnoDB'} ) {
goodprint "InnoDB buffer pool / data size: " goodprint "InnoDB buffer pool / data size: "
. hr_bytes( $myvar{'innodb_buffer_pool_size'} ) . "/" . hr_bytes( $myvar{'innodb_buffer_pool_size'} ) . "/"
@ -5416,12 +5416,15 @@ sub mysql_innodb {
. hr_bytes( $myvar{'innodb_buffer_pool_size'} ) . hr_bytes( $myvar{'innodb_buffer_pool_size'} )
. " should be equal 25%"; . " should be equal 25%";
push( @adjvars, push( @adjvars,
"innodb_log_file_size should be (=" "innodb_log_file_size should be (="
. hr_bytes_rnd( . hr_bytes_rnd(
$myvar{'innodb_buffer_pool_size'} / $myvar{'innodb_buffer_pool_size'} /
$myvar{'innodb_log_files_in_group'} / 4 $myvar{'innodb_log_files_in_group'} / 4
) )
. ") if possible, so InnoDB total log files size equals to 25% of buffer pool size." . ") if possible, so InnoDB total log files size equals to 25% of buffer pool size."
);
push( @generalrec,
"Read this before changing innodb_log_file_size and/or innodb_log_files_in_group: http://bit.ly/2wgkDvS"
); );
} }
else { else {
@ -5432,7 +5435,7 @@ sub mysql_innodb {
. " should be equal 25%"; . " should be equal 25%";
} }
# InnoDB Buffer Pull Instances (MySQL 5.6.6+) # InnoDB Buffer Pool Instances (MySQL 5.6.6+)
if ( defined( $myvar{'innodb_buffer_pool_instances'} ) ) { if ( defined( $myvar{'innodb_buffer_pool_instances'} ) ) {
# Bad Value if > 64 # Bad Value if > 64
@ -5442,12 +5445,12 @@ sub mysql_innodb {
push( @adjvars, "innodb_buffer_pool_instances (<= 64)" ); push( @adjvars, "innodb_buffer_pool_instances (<= 64)" );
} }
# InnoDB Buffer Pull Size > 1Go # InnoDB Buffer Pool Size > 1Go
if ( $myvar{'innodb_buffer_pool_size'} > 1024 * 1024 * 1024 ) { if ( $myvar{'innodb_buffer_pool_size'} > 1024 * 1024 * 1024 ) {
# InnoDB Buffer Pull Size / 1Go = InnoDB Buffer Pull Instances limited to 64 max. # InnoDB Buffer Pool Size / 1Go = InnoDB Buffer Pool Instances limited to 64 max.
# InnoDB Buffer Pull Size > 64Go # InnoDB Buffer Pool Size > 64Go
my $max_innodb_buffer_pool_instances = my $max_innodb_buffer_pool_instances =
int( $myvar{'innodb_buffer_pool_size'} / ( 1024 * 1024 * 1024 ) ); int( $myvar{'innodb_buffer_pool_size'} / ( 1024 * 1024 * 1024 ) );
$max_innodb_buffer_pool_instances = 64 $max_innodb_buffer_pool_instances = 64
@ -5468,7 +5471,7 @@ sub mysql_innodb {
. $myvar{'innodb_buffer_pool_instances'} . ""; . $myvar{'innodb_buffer_pool_instances'} . "";
} }
# InnoDB Buffer Pull Size < 1Go # InnoDB Buffer Pool Size < 1Go
} }
else { else {
if ( $myvar{'innodb_buffer_pool_instances'} != 1 ) { if ( $myvar{'innodb_buffer_pool_instances'} != 1 ) {
@ -6381,4 +6384,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# cperl-indent-level: 8 # cperl-indent-level: 8
# perl-indent-level: 8 # perl-indent-level: 8
# End: # End: