PT-VARI...-ADVISOR(1)
๐ NAME ๐
This is the pt-variable-advisor(1) page from the User Contributed Perl Documentation section, aka PT-VARI...-ADVISOR(1), bestie. Its whole job is literally to analyze MySQL variables and advise on possible problems. Main character energy for your config, fr fr. ๐
โจ SYNOPSIS โจ
Usage: pt-variable-advisor [OPTIONS] [DSN]
pt-variable-advisor analyzes variables and advises on possible problems.
Wanna pull SHOW VARIABLES from localhost? Do this:
pt-variable-advisor localhost
Got SHOW VARIABLES output saved in vars.txt? Serve it up like:
pt-variable-advisor --source-of-variables vars.txt
๐จ RISKS ๐จ
Okay so, real talk: Percona Toolkit is mature, proven in the real world, and well tested, but all database tools can pose a risk to the system and the database server. Not me being dramatic โ thatโs just the vibe check. Before using this tool, please:
- Read the tool's documentation
- Review the tool's known "BUGS"
- Test the tool on a non-production server
- Backup your production server and verify the backups
๐ DESCRIPTION ๐
pt-variable-advisor examines SHOW VARIABLES for bad values and settings according to the RULES described below. It reports on variables that match the rules, so you can find bad settings in your MySQL server. Lowkey a little detective for your database. ๐ต๏ธโโ๏ธโจ
๐ง RULES ๐ง
These are the rules that pt-variable-advisor will apply to SHOW VARIABLES. Each rule has three parts: an ID, a severity, and a description.
The rule's ID is a short, unique name for the rule. It usually relates to the variable that the rule examines. If a variable is examined by several rules, then the rules' IDs are numbered like -1, -2, -N. Cute little naming system, honestly.
The rule's severity is an indication of how important it is that this rule matched a query. We use NOTE, WARN, and CRIT to denote these levels.
The rule's description is a textual, human-readable explanation of what it means when a variable matches this rule. Depending on the verbosity of the report you generate, you will see more of the text in the description. By default, you'll see only the first sentence, which is sort of a terse synopsis of the rule's meaning. At a higher verbosity, you'll see subsequent sentences. So yeah โ turn the verbosity up if you want the full tea. ๐ต
auto_incrementโ severity: note. Are you trying to write to more than one server in a dual-source or ring replication configuration? Bestie, that is potentially very dangerous and in most cases is a serious mistake. Most people's reasons for doing this are actually not valid at all. Not the serve you think it is. ๐concurrent_insertโ severity: note. Holes (spaces left by deletes) in MyISAM tables might never be reused. Itโs giving โmessy room, no cleanup.โ ๐connect_timeoutโ severity: note. A large value of this setting can create a denial of service vulnerability. Highkey important. ๐จdebugโ severity: crit. Servers built with debugging capability should not be used in production because of the large performance impact. Periodt.delay_key_writeโ severity: warn. MyISAM index blocks are never flushed until necessary. If there is a server crash, data corruption on MyISAM tables can be much worse than usual. ๐ญflushโ severity: warn. This option might decrease performance greatly. Itโs literally in the name, bestie.flush_timeโ severity: warn. This option might decrease performance greatly.have_bdbโ severity: note. The BDB engine is deprecated. If you aren't using it, you should disable it with theskip_bdboption. Let it go, itโs not coming back. ๐ฆinit_connectโ severity: note. Theinit_connectoption is enabled on this server.init_fileโ severity: note. Theinit_fileoption is enabled on this server.init_slaveโ severity: note. Theinit_slaveoption is enabled on this server.init_replicaโ severity: note. Theinit_replicaoption is enabled on this server.innodb_additional_mem_pool_sizeโ severity: warn. This variable generally doesn't need to be larger than20MB. Like, why are you doing all that? ๐ซinnodb_buffer_pool_sizeโ severity: warn. The InnoDB buffer pool size is unconfigured. In a production environment it should always be configured explicitly, and the default10MBsize is not good. The default is not giving production-ready. ๐innodb_checksumsโ severity: warn. InnoDB checksums are disabled. Your data is not protected from hardware corruption or other errors! Not the safety vibe we want. ๐ญinnodb_doublewriteโ severity: warn. InnoDB doublewrite is disabled. Unless you use a filesystem that protects against partial page writes, your data is not safe!innodb_fast_shutdownโ severity: warn. InnoDB's shutdown behavior is not the default. This can lead to poor performance, or the need to perform crash recovery upon startup. Not the chill shutdown era.innodb_flush_log_at_trx_commit-1โ severity: warn. InnoDB is not configured in strictly ACID mode. If there is a crash, some transactions can be lost. Thatโs a big yikes. ๐innodb_flush_log_at_trx_commit-2โ severity: warn. Settinginnodb_flush_log_at_trx_committo0has no performance benefits over setting it to2, and more types of data loss are possible. If you are trying to change it from1for performance reasons, you should set it to2instead of0. Do with that what you will, bestie.innodb_force_recoveryโ severity: warn. InnoDB is in forced recovery mode! This should be used only temporarily when recovering from data corruption or other bugs, not for normal usage. Temporary era only, not permanent main character. ๐จinnodb_lock_wait_timeoutโ severity: warn. This option has an unusually long value, which can cause system overload if locks are not being released. Sweetie, why are we waiting forever.innodb_log_buffer_sizeโ severity: warn. The InnoDB log buffer size generally should not be set larger than16MB. If you are doing large BLOB operations, InnoDB is not really a good choice of engines anyway. Sorry to that engine. ๐ฌinnodb_log_file_sizeโ severity: warn. The InnoDB log file size is set to its default value, which is not usable on production systems.innodb_max_dirty_pages_pctโ severity: note. Theinnodb_max_dirty_pages_pctis lower than the default. This can cause overly aggressive flushing and add load to the I/O system. Itโs giving โtrying too hard.โ ๐งflush_timeโ severity: warn. This setting is likely to cause very bad performance everyflush_timeseconds.key_buffer_sizeโ severity: warn. The key buffer size is set to its default value, which is not good for most production systems. In a production environment,key_buffer_sizeshould be larger than the default8MBsize.large_pagesโ severity: note. Large pages are enabled.locked_in_memoryโ severity: note. The server is locked in memory with--memlock.log_warnings-1โ severity: note.Log_warningsis disabled, so unusual events such as statements unsafe for replication and aborted connections will not be logged to the error log. The receipts? Gone. ๐log_warnings-2โ severity: note.Log_warningsmust be set greater than1to log unusual events such as aborted connections.low_priority_updatesโ severity: note. The server is running with non-default lock priority for updates. This could cause update queries to wait unexpectedly for read queries. Awkward.max_binlog_sizeโ severity: note. Themax_binlog_sizeis smaller than the default of1GB.max_connect_errorsโ severity: note.max_connect_errorsshould probably be set as large as your platform allows.max_connectionsโ severity: warn. If the server ever really has more than a thousand threads running, then the system is likely to spend more time scheduling threads than really doing useful work. This variable's value should be considered in light of your workload. Like, context matters, bestie.myisam_repair_threadsโ severity: note.myisam_repair_threads>1enables multi-threaded repair, which is relatively untested and is still listed as beta-quality code in the official documentation. Beta-quality? In this economy? ๐ญold_passwordsโ severity: warn. Old-style passwords are insecure. They are sent in plain text across the wire. Not the secure little secret we thought. ๐optimizer_prune_levelโ severity: warn. The optimizer will use an exhaustive search when planning complex queries, which can cause the planning process to take a long time. Itโs giving โoverthinking the group project.โ ๐ซportโ severity: note. The server is listening on a non-default port.query_cache_size-1โ severity: note. The query cache does not scale to large sizes and can cause unstable performance when larger than128MB, especially on multi-core machines. Ngl, sounds stressful.query_cache_size-2โ severity: warn. The query cache can cause severe performance problems when it is larger than256MB, especially on multi-core machines.query_cache_size-3โ severity: note. The query cache can cause severe performance problems when it is enabled, especially in high concurrent loads on multi-core machines. The way that enabled query cache can be a whole situation.read_buffer_size-1โ severity: note. Theread_buffer_sizevariable should generally be left at its default unless an expert determines it is necessary to change it.read_buffer_size-2โ severity: warn. Theread_buffer_sizevariable should not be larger than8MB. It should generally be left at its default unless an expert determines it is necessary to change it. Making it larger than2MBcan hurt performance significantly, and can make the server crash, swap to death, or just become extremely unstable. That escalated quickly. ๐ญ๐ฅread_rnd_buffer_size-1โ severity: note. Theread_rnd_buffer_sizevariable should generally be left at its default unless an expert determines it is necessary to change it.read_rnd_buffer_size-2โ severity: warn. Theread_rnd_buffer_sizevariable should not be larger than4M. It should generally be left at its default unless an expert determines it is necessary to change it.relay_log_space_limitโ severity: warn. Settingrelay_log_space_limitcan cause replicas to stop fetching binary logs from their source immediately. This could increase the risk that your data will be lost if the replication source crashes. If the replicas have encountered a limit on relay log space, then it is possible that the latest transactions exist only on the source and no replica has retrieved them. Thatโs a no-cap scary one. ๐จslave_net_timeoutโ severity: warn. This variable is set too high. This is too long to wait before noticing that the connection to the replication source has failed and retrying. This should probably be set to60 secondsor less. It is also a good idea to usept-heartbeatto ensure that the connection does not appear to time out when the source is simply idle. Communication check, bestie. ๐replica_net_timeoutโ severity: warn.
This variable is set too high, bestie โ it's too long to wait before noticing that the connection to the replication source has failed and retrying. It should probably be set to 60 seconds or less. Also, using pt-heartbeat is a good idea so the connection doesn't look like it timed out when the source is just sitting there idle. ๐ซถ
slave_skip_errors
severity: crit
Do not set this option, bestie. If replication is having errors, you need to find and resolve the cause of that โ it's likely your replica's data is different from the source. You can find out with pt-table-checksum. ๐จ
replica_skip_errors
severity: crit
Same energy, same warning: do not set this option. If replication is having errors, you need to find and resolve the cause of that โ it's likely your replica's data is different from the source. You can find out with pt-table-checksum. ๐จ
sort_buffer_size-1
severity: note
The sort_buffer_size variable should generally be left at its default unless an expert determines it is necessary to change it. โจ
sort_buffer_size-2
severity: note
Again: the sort_buffer_size variable should generally be left at its default unless an expert determines it is necessary to change it. Making it larger than a few MB can hurt performance significantly, and can make the server crash, swap to death, or just become extremely unstable. ๐
sql_notes
severity: note
This server is configured not to log Note level warnings to the error log. ๐
sync_frm
severity: warn
It's best to set sync_frm so that .frm files are flushed safely to disk in case of a server crash. ๐
tx_isolation-1
severity: note
This server's transaction isolation level is non-default. ๐
tx_isolation-2
severity: warn
Most applications should use the default REPEATABLE-READ transaction isolation level, or in a few cases READ-COMMITTED. ๐ธ
expire_logs_days
severity: warn
Binary logs are enabled, but automatic purging is not enabled. If you don't purge binary logs, your disk will fill up. If you delete binary logs externally to MySQL, you will cause unwanted behaviors. Always ask MySQL to purge obsolete logs โ never delete them externally. ๐๏ธ
innodb_file_io_threads
severity: note
This option is useless except on Windows. ๐
innodb_data_file_path
severity: note
Auto-extending InnoDB files can consume a lot of disk space that is very difficult to reclaim later. Some people prefer to set innodb_file_per_table and allocate a fixed-size file for ibdata1. ๐
innodb_flush_method
severity: note
Most production database servers that use InnoDB should set innodb_flush_method to O_DIRECT to avoid double-buffering, unless the I/O system is very low performance. โก
innodb_locks_unsafe_for_binlog
severity: warn
This option makes point-in-time recovery from binary logs, and replication, untrustworthy if statement-based logging is used. ๐ฌ
innodb_support_xa
severity: warn
MySQL's internal XA transaction support between InnoDB and the binary log is disabled. The binary log might not match InnoDB's state after crash recovery, and replication might drift out of sync due to out-of-order statements in the binary log. ๐
log_bin
severity: warn
Binary logging is disabled, so point-in-time recovery and replication are not possible. ๐ญ
log_output
severity: warn
Directing log output to tables has a high performance impact. ๐
max_relay_log_size
severity: note
A custom max_relay_log_size is defined. ๐๏ธ
myisam_recover_options
severity: warn
myisam_recover_options should be set to some value such as BACKUP,FORCE to ensure that table corruption is noticed. ๐ง
storage_engine
severity: note
The server is using a non-standard storage engine as default. ๐ง
sync_binlog
severity: warn
Binary logging is enabled, but sync_binlog isn't configured so that every transaction is flushed to the binary log for durability. ๐พ
tmp_table_size
severity: note
The effective minimum size of in-memory implicit temporary tables used internally during query execution is min(tmp_table_size, max_heap_table_size), so max_heap_table_size should be at least as large as tmp_table_size. ๐งฎ
old mysql version
severity: warn
These are the recommended minimum version for each major release: 3.23, 4.1.20, 5.0.37, 5.1.30, 5.5.8, 5.6.10, 5.7.9, 8.0.11. This option does not complain about Innovation releases. โณ
end-of-life mysql version
severity: note
Every release older than 8.0 is now officially end-of-life. ๐ชฆ
๐ OPTIONS ๐
This tool accepts additional command-line arguments. Refer to the SYNOPSIS and usage information for details. ๐ซถ
--ask-passโ Prompt for a password when connecting to MySQL. ๐--[no]buffer-stdoutโ default:yes. Enables STDOUT buffering. Disable this option if you want to see live progress when using output post-processing tools such asteeorkubectl logs. ๐--charsetโ short form:-A; type:string. Default character set. If the value isutf8, sets Perl'sbinmodeon STDOUT toutf8, passes themysql_enable_utf8option toDBD::mysql, and runsSET NAMES UTF8after connecting to MySQL. Any other value setsbinmodeon STDOUT without theutf8layer, and runsSET NAMESafter connecting to MySQL. ๐--configโ type:Array. Read this comma-separated list of config files; if specified, this must be the first option on the command line. ๐--daemonizeโ Fork to the background and detach from the shell. POSIX operating systems only. ๐ง--databaseโ short form:-D; type:string. Connect to this database. ๐๏ธ--defaults-fileโ short form:-F; type:string. Only read mysql options from the given file. You must give an absolute pathname. ๐--helpโ Show help and exit. ๐--hostโ short form:-h; type:string. Connect to host. ๐--ignore-rulesโ type:hash. Ignore these rule IDs.
Specify a comma-separated list of rule IDs (e.g. LIT.001,RES.002,etc.) to ignore. ๐
โโ๏ธ
--mysql_sslโ short form:-s; type:int. Create SSL MySQL connection. ๐--passwordโ short form:-p; type:string. Password to use when connecting. If password contains commas they must be escaped with a backslash:exam\,ple. ๐--pidโ type:string. Create the given PID file. The tool won't start if the PID file already exists and the PID it contains is different than the current PID. However, if the PID file exists and the PID it contains is no longer running, the tool will overwrite the PID file with the current PID. The PID file is removed automatically when the tool exits. ๐งพ--portโ short form:-P; type:int. Port number to use for connection. ๐--set-varsโ type:Array. Set the MySQL variables in this comma-separated list ofvariable=valuepairs.
By default, the tool sets:
wait_timeout=10000
Variables specified on the command line override these defaults. For example, specifying --set-vars wait_timeout=500 overrides the default value of 10000.
The tool prints a warning and continues if a variable cannot be set. โ๏ธ
--socketโ short form:-S; type:string. Socket file to use for connection. ๐งฆ--source-of-variablesโ type:string; default:mysql. ReadSHOW VARIABLESfrom this source. Possible values aremysql,noneor a file name. Ifmysqlis specified then you must also specify a DSN on the command line. ๐--userโ short form:-u; type:string. User for login if not current user. ๐ค--verboseโ short form:-v; cumulative:yes; default:1. Increase verbosity of output. At the default level of verbosity, the program prints only the first sentence of each rule's description. At higher levels, the program prints more of the description. ๐ฃ๏ธ--versionโ Show version and exit. ๐ท๏ธ--[no]version-checkโ default:yes. Check for the latest version of Percona Toolkit, MySQL, and other programs.
This is a standard "check for updates automatically" feature, with two additional features. First, the tool checks its own version and also the versions of the following software: operating system, Percona Monitoring and Management (PMM), MySQL, Perl, MySQL driver for Perl (DBD::mysql), and Percona Toolkit. Second, it checks for and warns about versions with known problems. For example, MySQL 5.5.25 had a critical bug and was re-released as 5.5.25a.
A secure connection to Perconaโs Version Check database server is done to perform these checks. Each request is logged by the server, including software version numbers and unique ID of the checked system. The ID is generated by the Percona Toolkit installation script or when the Version Check database call is done for the first time.
Any updates or known problems are printed to STDOUT before the tool's normal output. This feature should never interfere with the normal operation of the tool.
For more information, visit https://www.percona.com/doc/percona-toolkit/LATEST/version-check.html. ๐
๐ DSN OPTIONS ๐
okay so these DSN options are what you use to create a DSN, bestie. Each option is given like option=value. The options are case-sensitive, so P and p are not the same option. There cannot be whitespace before or after the =, and if the value contains whitespace it must be quoted. DSN options are comma-separated. See the percona-toolkit manpage for full details. ๐
Aโdsn: charset; copy: yesโ Default character set. โจDโdsn: database; copy: yesโ Default database. ๐Fโdsn: mysql_read_default_file; copy: yesโ Only read default options from the given file. ๐hโdsn: host; copy: yesโ Connect to host. ๐ฆpโdsn: password; copy: yesโ Password to use when connecting. If password contains commas they must be escaped with a backslash:exam\,ple๐ญPโdsn: port; copy: yesโ Port number to use for connection. ๐ฅSโdsn: mysql_socket; copy: yesโ Socket file to use for connection. ๐ธuโdsn: user; copy: yesโ User for login if not current user. ๐sโdsn: mysql_ssl; copy: yesโ Create SSL connection. ๐
๐ง ENVIRONMENT ๐ง
The environment variable PTDEBUG enables verbose debugging output to STDERR. To enable debugging and capture all output to a file, run the tool like:
PTDEBUG=1 pt-variable-advisor ... > FILE 2>&1
Be careful bestie: debugging output is voluminous and can generate several megabytes of output. ๐ญ๐
๐จ ATTENTION ๐จ
Using <PTDEBUG> might expose passwords. When debug is enabled, all command line parameters are shown in the output. ๐๐
โญ SYSTEM REQUIREMENTS โญ
You need Perl, DBI, DBD::mysql, and some core packages that ought to be installed in any reasonably new version of Perl. ๐ซถ
๐ BUGS ๐
For a list of known bugs, see https://jira.percona.com/projects/PT/issues.
Please report bugs at https://jira.percona.com/projects/PT. Include the following information in your bug report:
- Complete command-line used to run the tool
- Tool
--version - MySQL version of all servers involved
- Output from the tool including STDERR
- Input files (log/dump/config files, etc.)
If possible, include debugging output by running the tool with PTDEBUG; see "ENVIRONMENT". ๐
๐ฆ DOWNLOADING ๐ฆ
Visit http://www.percona.com/software/percona-toolkit/ to download the latest release of Percona Toolkit. Or, get the latest release from the command line:
wget percona.com/get/percona-toolkit.tar.gz
wget percona.com/get/percona-toolkit.rpm
wget percona.com/get/percona-toolkit.deb
You can also get individual tools from the latest release:
wget percona.com/get/TOOL
Replace TOOL with the name of any tool. โจ
๐ AUTHORS ๐
Baron Schwartz and Daniel Nichter ๐
๐ธ ABOUT PERCONA TOOLKIT ๐ธ
This tool is part of Percona Toolkit, a collection of advanced command-line tools for MySQL developed by Percona. Percona Toolkit was forked from two projects in June, 2011: Maatkit and Aspersa. Those projects were created by Baron Schwartz and primarily developed by him and Daniel Nichter. Visit http://www.percona.com/software/ to learn about other free, open-source software from Percona. ๐ซถ
๐ COPYRIGHT, LICENSE, AND WARRANTY ๐
This program is copyright 2010-2026 Percona LLC and/or its affiliates.
THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ๐ซ
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2; OR the Perl Artistic License. On UNIX and similar systems, you can issue man perlgpl or man perlartistic to read these licenses.
You should have received a copy of the GNU General Public License, version 2 along with this program; if not, see https://www.gnu.org/licenses/. ๐
๐ VERSION ๐
pt-variable-advisor 3.7.1-4
๐ POD ERRORS ๐
Hey! The above document had some coding errors, which are explained below:
Around line 6261:
Non-ASCII character seen before =encoding in 'Perconaโs'. Assuming UTF-8
That's the whole page, bestie. Source/version vibe: perl v5.42.2, dated 2026-09-01, paging you as PT-VARI...-ADVISOR(1) ๐โจ
๐ฆ where this page comes from
- arch rolling: percona-toolkit 3.7.1_4-1 ยท GPL
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms