From cb4784e8c730365f7d1b6bc6c07176e17eb61419 Mon Sep 17 00:00:00 2001 From: Jean-Marie Renouard Date: Tue, 30 May 2023 09:11:06 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Revert=20pr=C3=A9view=20on=20skip=20name=20?= =?UTF-8?q?resolve=20Name=20resolve=20should=20be=20OFF=20by=20default=20e?= =?UTF-8?q?xcept=20for=20CPANEL=20&=20FLEX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mysqltuner.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 83fa800..38f1973 100644 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -3275,13 +3275,13 @@ sub mysql_stats { push( @adjvars, "skip-name-resolve=0" ); } } - elsif ( $result{'Variables'}{'skip_name_resolve'} eq 'OFF' ) { + elsif ( $result{'Variables'}{'skip_name_resolve'} ne 'OFF' ) { badprint "Name resolution is active: a reverse name resolution is made for each new connection which can reduce performance"; push( @generalrec, -"Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1" +"Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=OFF" ); - push( @adjvars, "skip-name-resolve=1" ); + push( @adjvars, "skip-name-resolve=OFF" ); } # Query cache @@ -3965,11 +3965,11 @@ sub mysqsl_pfs { # Store all sys schema in dumpdir if defined if ( defined $opt{dumpdir} and -d "$opt{dumpdir}" ) { - for my $pfs_view ( select_array('use sys;show tables;') ) { - infoprint "Dumping $pfs_view into $opt{dumpdir}"; + for my $sys_view ( select_array('use sys;show tables;') ) { + infoprint "Dumping $sys_view into $opt{dumpdir}"; select_csv_file( - "$opt{dumpdir}/pfs_$pfs_view.csv", - "select * from sys.$pfs_view" + "$opt{dumpdir}/sys_$sys_view.csv", + "select * from sys.\`$sys_view\`" ); } exit 0 if ( $opt{stop} == 1 ); From 8aacb0f85d5cf634ddbe060640a203a6991c3e22 Mon Sep 17 00:00:00 2001 From: Jean-Marie Renouard Date: Wed, 7 Jun 2023 17:23:33 +0200 Subject: [PATCH 2/2] Feat: new options --feature aloowing testing one feature at a time --- mysqltuner.pl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 7dc564d..08425e8 100644 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -111,6 +111,7 @@ my %opt = ( "defaults-extra-file" => '', "protocol" => '', "dumpdir" => '', + "feature" => '', "stop" => 0, ); @@ -144,7 +145,7 @@ GetOptions( 'idxstat', 'noidxstat', 'server-log=s', 'protocol=s', 'defaults-extra-file=s', 'dumpdir=s', - 'stop' + 'feature=s', 'stop' ) or pod2usage( -exitval => 1, @@ -3928,7 +3929,7 @@ sub get_pf_memory { } # Recommendations for Performance Schema -sub mysqsl_pfs { +sub mysql_pfs { subheaderprint "Performance schema"; # Performance Schema @@ -6932,6 +6933,15 @@ debugprint "MySQL Admin FINAL Client : $mysqladmincmd $mysqllogin"; os_setup; # Set up some OS variables get_all_vars; # Toss variables/status into hashes get_tuning_info; # Get information about the tuning connection +calculations; # Calculate everything we need + +if ($opt{'feature'} ne '') { + subheaderprint "Running feature: $opt{'feature'}"; + no strict 'refs'; + my $feature=$opt{'feature'}; + $feature->(); + exit(0) +} validate_mysql_version; # Check current MySQL version check_architecture; # Suggest 64-bit upgrade @@ -6949,9 +6959,9 @@ mysql_triggers; # Show information about triggers mysql_routines; # Show information about routines security_recommendations; # Display some security recommendations cve_recommendations; # Display related CVE -calculations; # Calculate everything we need + mysql_stats; # Print the server stats -mysqsl_pfs; # Print Performance schema info +mysql_pfs; # Print Performance schema info mariadb_threadpool; # Print MariaDB ThreadPool stats mysql_myisam; # Print MyISAM stats