The Performance Schema implements several system variables that provide configuration information:
mysql> SHOW VARIABLES LIKE 'perf%';
+--------------------------------------------------------+---------+
| Variable_name | Value |
+--------------------------------------------------------+---------+
| performance_schema | ON |
| performance_schema_accounts_size | 100 |
| performance_schema_digests_size | 200 |
| performance_schema_events_stages_history_long_size | 10000 |
| performance_schema_events_stages_history_size | 10 |
| performance_schema_events_statements_history_long_size | 10000 |
| performance_schema_events_statements_history_size | 10 |
| performance_schema_events_waits_history_long_size | 10000 |
| performance_schema_events_waits_history_size | 10 |
| performance_schema_hosts_size | 100 |
| performance_schema_max_cond_classes | 80 |
| performance_schema_max_cond_instances | 1000 |
| performance_schema_max_file_classes | 50 |
| performance_schema_max_file_handles | 32768 |
| performance_schema_max_file_instances | 10000 |
| performance_schema_max_mutex_classes | 200 |
| performance_schema_max_mutex_instances | 1000000 |
| performance_schema_max_rwlock_classes | 30 |
| performance_schema_max_rwlock_instances | 1000000 |
| performance_schema_max_socket_classes | 10 |
| performance_schema_max_socket_instances | 1000 |
| performance_schema_max_stage_classes | 150 |
| performance_schema_max_statement_classes | 165 |
| performance_schema_max_table_handles | 10000 |
| performance_schema_max_table_instances | 1000 |
| performance_schema_max_thread_classes | 50 |
| performance_schema_max_thread_instances | 1000 |
| performance_schema_session_connect_attrs_size | 512 |
| performance_schema_setup_actors_size | 100 |
| performance_schema_setup_objects_size | 100 |
| performance_schema_users_size | 100 |
+--------------------------------------------------------+---------+
Performance Schema system variables can be set at server startup on the command line or in option files, and many can be set at runtime. See Performance Schema Option and Variable Reference.
As of MySQL 5.6.6, the Performance Schema automatically sizes the values of several of its parameters at server startup if they are not set explicitly. For more information, see Section 3.2, “Performance Schema Startup Configuration”.
Performance Schema system variables have the following meanings:
| Command-Line Format | --performance_schema=# | ||
| System Variable | Name | performance_schema | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | boolean | |
| Default | OFF | ||
| Permitted Values (>= 5.6.6) | Type | boolean | |
| Default | ON | ||
The value of this variable is ON or
OFF to indicate whether the Performance
Schema is enabled. By default, the value is
ON by default as of MySQL 5.6.6 and
OFF before that. At server startup, you can
specify this variable with no value or a value of
ON or 1 to enable it, or with a value of
OFF or 0 to disable it.
performance_schema_accounts_size
| Introduced | 5.6.3 | ||
| Command-Line Format | --performance_schema_accounts_size=# | ||
| System Variable | Name | performance_schema_accounts_size | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 10 | ||
| Min Value | 0 | ||
| Max Value | 1048576 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
| Min Value | -1 (autosized) | ||
| Max Value | 1048576 | ||
The number of rows in the
accounts table. If this variable
is 0, the Performance Schema does not maintain connection
statistics in the accounts table.
This variable was added in MySQL 5.6.3.
performance_schema_digests_size
| Introduced | 5.6.5 | ||
| Command-Line Format | --performance_schema_digests_size=# | ||
| System Variable | Name | performance_schema_digests_size | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | -1 (autosized) | ||
| Min Value | -1 | ||
| Max Value | 1048576 | ||
The maximum number of rows in the
events_statements_summary_by_digest
table. This variable was added in MySQL 5.6.5. If this maximum
is exceeded such that a digest cannot be instrumented, the
Performance Schema increments the
Performance_schema_digest_lost
status variable.
performance_schema_events_stages_history_long_size
| Introduced | 5.6.3 | ||
| Command-Line Format | --performance_schema_events_stages_history_long_size=# | ||
| System Variable | Name | performance_schema_events_stages_history_long_size | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 10000 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The number of rows in the
events_stages_history_long table.
This variable was added in MySQL 5.6.3.
performance_schema_events_stages_history_size
| Introduced | 5.6.3 | ||
| Command-Line Format | --performance_schema_events_stages_history_size=# | ||
| System Variable | Name | performance_schema_events_stages_history_size | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 10 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The number of rows per thread in the
events_stages_history table. This
variable was added in MySQL 5.6.3.
performance_schema_events_statements_history_long_size
| Introduced | 5.6.3 | ||
| Command-Line Format | --performance_schema_events_statements_history_long_size=# | ||
| System Variable | Name | performance_schema_events_statements_history_long_size | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 10000 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The number of rows in the
events_statements_history_long
table. This variable was added in MySQL 5.6.3.
performance_schema_events_statements_history_size
| Introduced | 5.6.3 | ||
| Command-Line Format | --performance_schema_events_statements_history_size=# | ||
| System Variable | Name | performance_schema_events_statements_history_size | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 10 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The number of rows per thread in the
events_statements_history table.
This variable was added in MySQL 5.6.3.
performance_schema_events_waits_history_long_size
| Command-Line Format | --performance_schema_events_waits_history_long_size=# | ||
| System Variable | Name | performance_schema_events_waits_history_long_size | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 10000 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The number of rows in the
events_waits_history_long table.
performance_schema_events_waits_history_size
| Command-Line Format | --performance_schema_events_waits_history_size=# | ||
| System Variable | Name | performance_schema_events_waits_history_size | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 10 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The number of rows per thread in the
events_waits_history table.
| Introduced | 5.6.3 | ||
| Command-Line Format | --performance_schema_hosts_size=# | ||
| System Variable | Name | performance_schema_hosts_size | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 10 | ||
| Min Value | 0 | ||
| Max Value | 1048576 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
| Min Value | -1 (autosized) | ||
| Max Value | 1048576 | ||
The number of rows in the hosts
table. If this variable is 0, the Performance Schema does not
maintain connection statistics in the
hosts table. This variable was
added in MySQL 5.6.3.
performance_schema_max_cond_classes
| Command-Line Format | --performance_schema_max_cond_classes=# | ||
| System Variable | Name | performance_schema_max_cond_classes | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 80 | ||
The maximum number of condition instruments.
performance_schema_max_cond_instances
| Command-Line Format | --performance_schema_max_cond_instances=# | ||
| System Variable | Name | performance_schema_max_cond_instances | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 1000 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The maximum number of instrumented condition objects.
performance_schema_max_digest_length
| Introduced | 5.6.26 | ||
| Command-Line Format | --performance_schema_max_digest_length=# | ||
| System Variable | Name | performance_schema_max_digest_length | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 1024 | ||
| Min Value | 0 | ||
| Max Value | 1048576 | ||
The maximum number of bytes available for computing statement
digests (see
Performance Schema Statement Digests). This
variable is like
max_digest_length, but
applies to the Performance Schema only. For more information,
see the description of that variable in
Server System Variables
This variable was added in MySQL 5.6.26.
max_digest_length. In MySQL
5.6.24 and 5.6.25, use
max_digest_length instead.
Before 5.6.24, the value cannot be changed.
performance_schema_max_file_classes
| Command-Line Format | --performance_schema_max_file_classes=# | ||
| System Variable | Name | performance_schema_max_file_classes | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 50 | ||
The maximum number of file instruments.
performance_schema_max_file_handles
| Command-Line Format | --performance_schema_max_file_handles=# | ||
| System Variable | Name | performance_schema_max_file_handles | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 32768 | ||
The maximum number of opened file objects.
The value of
performance_schema_max_file_handles
should be greater than the value of
open_files_limit:
open_files_limit affects the
maximum number of open file handles the server can support and
performance_schema_max_file_handles
affects how many of these file handles can be instrumented.
performance_schema_max_file_instances
| Command-Line Format | --performance_schema_max_file_instances=# | ||
| System Variable | Name | performance_schema_max_file_instances | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 10000 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The maximum number of instrumented file objects.
performance_schema_max_mutex_classes
| Command-Line Format | --performance_schema_max_mutex_classes=# | ||
| System Variable | Name | performance_schema_max_mutex_classes | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 200 | ||
The maximum number of mutex instruments.
performance_schema_max_mutex_instances
| Command-Line Format | --performance_schema_max_mutex_instances=# | ||
| System Variable | Name | performance_schema_max_mutex_instances | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 1000 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The maximum number of instrumented mutex objects.
performance_schema_max_rwlock_classes
| Command-Line Format | --performance_schema_max_rwlock_classes=# | ||
| System Variable | Name | performance_schema_max_rwlock_classes | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (5.6.0) | Type | integer | |
| Default | 20 | ||
| Permitted Values (>= 5.6.1, <= 5.6.14) | Type | integer | |
| Default | 30 | ||
| Permitted Values (>= 5.6.15) | Type | integer | |
| Default | 40 | ||
The maximum number of rwlock instruments.
performance_schema_max_rwlock_instances
| Command-Line Format | --performance_schema_max_rwlock_instances=# | ||
| System Variable | Name | performance_schema_max_rwlock_instances | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 1000 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The maximum number of instrumented rwlock objects.
performance_schema_max_socket_classes
| Introduced | 5.6.3 | ||
| Command-Line Format | --performance_schema_max_socket_classes=# | ||
| System Variable | Name | performance_schema_max_socket_classes | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 10 | ||
The maximum number of socket instruments. This variable was added in MySQL 5.6.3.
performance_schema_max_socket_instances
| Introduced | 5.6.3 | ||
| Command-Line Format | --performance_schema_max_socket_instances=# | ||
| System Variable | Name | performance_schema_max_socket_instances | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 1000 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The maximum number of instrumented socket objects. This variable was added in MySQL 5.6.3.
performance_schema_max_stage_classes
| Introduced | 5.6.3 | ||
| Command-Line Format | --performance_schema_max_stage_classes=# | ||
| System Variable | Name | performance_schema_max_stage_classes | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 150 | ||
The maximum number of stage instruments. This variable was added in MySQL 5.6.3.
performance_schema_max_statement_classes
| Introduced | 5.6.3 | ||
| Command-Line Format | --performance_schema_max_statement_classes=# | ||
| System Variable | Name | performance_schema_max_statement_classes | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | -1 (autosized) | ||
The maximum number of statement instruments. The default value is calculated at server build time based on the number of commands in the client/server protocol and the number of SQL statement types supported by the server.
This variable should not be changed, unless to set it to 0 to disable all statement instrumentation and save all memory associated with it. Setting the variable to nonzero values other than the default has no benefit; in particular, values larger than the default cause more memory to be allocated then is needed.
This variable was added in MySQL 5.6.3.
performance_schema_max_table_handles
| Command-Line Format | --performance_schema_max_table_handles=# | ||
| System Variable | Name | performance_schema_max_table_handles | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 100000 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The maximum number of opened table objects.
performance_schema_max_table_instances
| Command-Line Format | --performance_schema_max_table_instances=# | ||
| System Variable | Name | performance_schema_max_table_instances | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 50000 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The maximum number of instrumented table objects.
performance_schema_max_thread_classes
| Command-Line Format | --performance_schema_max_thread_classes=# | ||
| System Variable | Name | performance_schema_max_thread_classes | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 50 | ||
The maximum number of thread instruments.
performance_schema_max_thread_instances
| Command-Line Format | --performance_schema_max_thread_instances=# | ||
| System Variable | Name | performance_schema_max_thread_instances | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 1000 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
The maximum number of instrumented thread objects. The value
controls the size of the threads
table. If this maximum is exceeded such that a thread cannot
be instrumented, the Performance Schema increments the
Performance_schema_thread_instances_lost
status variable.
The max_connections system
variable affects how many threads are run in the server.
performance_schema_max_thread_instances
affects how many of these running threads can be instrumented.
The default value of
performance_schema_max_thread_instances
is autosized based on the value of
max_connections.
performance_schema_session_connect_attrs_size
| Introduced | 5.6.6 | ||
| Command-Line Format | --performance_schema_session_connect_attrs_size=# | ||
| System Variable | Name | performance_schema_session_connect_attrs_size | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | -1 (autosized) | ||
| Min Value | -1 | ||
| Max Value | 1048576 | ||
The amount of preallocated memory per thread reserved to hold
connection attribute key/value pairs. If the aggregate size of
connection attribute data sent by a client is larger than this
amount, the Performance Schema truncates the attribute data,
increments the
Performance_schema_session_connect_attrs_lost
status variable, and writes a message to the error log
indicating that truncation occurred if the
log_warnings system variable
value is greater than zero.
The default value of
performance_schema_session_connect_attrs_size
is autosized at server startup. This value may be small, so if
truncation occurs
(Performance_schema_session_connect_attrs_lost
becomes nonzero), you may wish to set
performance_schema_session_connect_attrs_size
explicitly to a larger value.
Although the maximum permitted
performance_schema_session_connect_attrs_size
value is 1MB, the effective maximum is 64KB because the server
imposes a limit of 64KB on the aggregate size of connection
attribute data it will accept. If a client attempts to send
more than 64KB of attribute data, the server rejects the
connection. For more information, see
Section 8.8, “Performance Schema Connection Attribute Tables”.
This variable was added in MySQL 5.6.7.
performance_schema_setup_actors_size
| Introduced | 5.6.1 | ||
| Command-Line Format | --performance_schema_setup_actors_size=# | ||
| System Variable | Name | performance_schema_setup_actors_size | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 100 | ||
The number of rows in the
setup_actors table.
performance_schema_setup_objects_size
| Introduced | 5.6.1 | ||
| Command-Line Format | --performance_schema_setup_objects_size=# | ||
| System Variable | Name | performance_schema_setup_objects_size | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 100 | ||
The number of rows in the
setup_objects table.
| Introduced | 5.6.3 | ||
| Command-Line Format | --performance_schema_users_size=# | ||
| System Variable | Name | performance_schema_users_size | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values (<= 5.6.5) | Type | integer | |
| Default | 10 | ||
| Min Value | 0 | ||
| Max Value | 1048576 | ||
| Permitted Values (>= 5.6.6) | Type | integer | |
| Default | -1 (autosized) | ||
| Min Value | -1 (autosized) | ||
| Max Value | 1048576 | ||
The number of rows in the users
table. If this variable is 0, the Performance Schema does not
maintain connection statistics in the
users table. This variable was
added in MySQL 5.6.3.