Skip to content

Commit

Permalink
MErge beetween all staff related to Galera Cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrenouard committed Mar 8, 2017
2 parents f04b32c + 39f02cd commit e44c29b
Showing 1 changed file with 32 additions and 8 deletions.
40 changes: 32 additions & 8 deletions mysqltuner.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
# mysqltuner.pl - Version 1.7.0
# mysqltuner.pl - Version 1.7.1
# High Performance MySQL Tuning Script
# Copyright (C) 2006-2016 Major Hayden - major@mhtx.net
#
Expand Down Expand Up @@ -31,6 +31,7 @@
# Simon Greenaway Adam Stein Isart Montane
# Baptiste M. Cole Turner Major Hayden
# Joe Ashcraft Jean-Marie Renouard Christian Loos
# Julien Francoz
#
# Inspired by Matthew Montgomery's tuning-primer.sh script:
# http://forge.mysql.com/projects/view.php?id=44
Expand All @@ -54,7 +55,7 @@ package main;
#use Env;

# Set up a few variables for use in the script
my $tunerversion = "1.7.0";
my $tunerversion = "1.7.1";
my ( @adjvars, @generalrec );

# Set defaults
Expand Down Expand Up @@ -5064,24 +5065,47 @@ sub mariadb_galera {
{
badprint "gcs.limit should be equal to 5 * wsrep_slave_threads";
push @adjvars, "gcs.limit= wsrep_slave_threads * 5";
} else {
goodprint "wsrep_slave_threads is equal to 3 or 4 times number of CPU(s)";
}
else {
goodprint "gcs.limit is equal to 5 * wsrep_slave_threads";

if (get_wsrep_option('wsrep_slave_threads') > 1) {
badprint "wsrep parallel slave can cause frequent inconsistency crash.";
push @adjvars, "Set wsrep_slave_threads to 1 in case of HA_ERR_FOUND_DUPP_KEY crash on slave";
# check options for parallel slave
if (get_wsrep_option('wsrep_slave_FK_checks') eq "OFF") {
badprint "wsrep_slave_FK_checks is off with parallel slave";
push @adjvars, "wsrep_slave_FK_checks should be ON when using parallel slave";
}
# wsrep_slave_UK_checks seems useless in MySQL source code
if ($myvar{'innodb_autoinc_lock_mode'} != 2) {
badprint "innodb_autoinc_lock_mode is incorrect with parallel slave";
push @adjvars, "innodb_autoinc_lock_mode should be 2 when using parallel slave";
}
}

if (get_wsrep_option('gcs.fc_limit') != $myvar{'wsrep_slave_threads'} * 5 ) {
badprint "gcs.fc_limit should be equal to 5 * wsrep_slave_threads";
push @adjvars, "gcs.fc_limit= wsrep_slave_threads * 5";
} else {
goodprint "gcs.fc_limit is equal to 5 * wsrep_slave_threads";
}
if ( get_wsrep_option('gcs.fc_factor') == 0.8 ) {

if (get_wsrep_option('gcs.fc_factor') != 0.8 ) {
badprint "gcs.fc_factor should be equal to 0.8";
push @adjvars, "gcs.fc_factor=0.8";
}
else {
goodprint "gcs.limit is equal to 5 * wsrep_slave_threads";
goodprint "gcs.fc_factor is equal to 0.8";
}
if ( get_wsrep_option('wsrep_flow_control_paused') > 0.02 ) {
if ( get_wsrep_option('wsrep_flow_control_paused') > 0.02 ) {
badprint "Fraction of time node pause flow control > 0.02";
}
else {
goodprint
"Flow control fraction seems to be OK (wsrep_flow_control_paused<=0.02)";
}

if ( scalar(@primaryKeysNbTables) > 0 ) {
badprint "Following table(s) don't have primary key:";
foreach my $badtable (@primaryKeysNbTables) {
Expand Down Expand Up @@ -6034,7 +6058,7 @@ sub which {
=head1 NAME
MySQLTuner 1.7.0 - MySQL High Performance Tuning Script
MySQLTuner 1.7.1 - MySQL High Performance Tuning Script
=head1 IMPORTANT USAGE GUIDELINES
Expand Down

1 comment on commit e44c29b

@solracsf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmrenouard values are double and inconsistent:

[!!] wsrep_slave_threads is not equal to 3 or 4 times number of CPU(s)
[OK] wsrep_slave_threads is equal to 3 or 4 times number of CPU(s)

it also stills outputing

wsrep_slave_threads= Nb of Core CPU * 4

but

wsrep_slave_threads=4

for 1 CPU core VPS

Please sign in to comment.