The Performance Schema implements several system variables that provide configuration information:
mysql> SHOW VARIABLES LIKE 'perf%';
+---------------------------------------------------+---------+
| Variable_name | Value |
+---------------------------------------------------+---------+
| performance_schema | ON |
| performance_schema_events_waits_history_long_size | 10000 |
| performance_schema_events_waits_history_size | 10 |
| 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_table_handles | 100000 |
| performance_schema_max_table_instances | 50000 |
| performance_schema_max_thread_classes | 50 |
| performance_schema_max_thread_instances | 1000 |
+---------------------------------------------------+---------+
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 Section 22.9, “Performance Schema Option and Variable Reference”.
Performance Schema system variables have the following meanings:
| Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema=# | ||
| System Variable | Name | performance_schema | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | boolean | |
| Default | OFF | ||
The value of this variable is ON or
OFF to indicate whether the Performance
Schema is enabled. By default, the value is
OFF. At server startup, you can specify
this variable with no value or a value of 1 to enable it, or
with a value of 0 to disable it.
performance_schema_events_waits_history_long_size
| Introduced | 5.5.3 | ||
| 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 | Type | integer | |
| Default | 10000 | ||
The number of rows in the
events_waits_history_long table.
performance_schema_events_waits_history_size
| Introduced | 5.5.3 | ||
| 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 | Type | integer | |
| Default | 10 | ||
The number of rows per thread in the
events_waits_history table.
performance_schema_max_cond_classes
| Introduced | 5.5.3 | ||
| 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
| Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_cond_instances=# | ||
| System Variable | Name | performance_schema_max_cond_instances | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 1000 | ||
The maximum number of instrumented condition objects.
performance_schema_max_file_classes
| Introduced | 5.5.3 | ||
| 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
| Introduced | 5.5.3 | ||
| 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
| Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_file_instances=# | ||
| System Variable | Name | performance_schema_max_file_instances | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 10000 | ||
The maximum number of instrumented file objects.
performance_schema_max_mutex_classes
| Introduced | 5.5.3 | ||
| 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
| Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_mutex_instances=# | ||
| System Variable | Name | performance_schema_max_mutex_instances | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 1000 | ||
The maximum number of instrumented mutex objects.
performance_schema_max_rwlock_classes
| Introduced | 5.5.3 | ||
| 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.5.6) | Type | integer | |
| Default | 20 | ||
| Permitted Values (>= 5.5.7) | Type | integer | |
| Default | 30 | ||
The maximum number of rwlock instruments.
performance_schema_max_rwlock_instances
| Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_rwlock_instances=# | ||
| System Variable | Name | performance_schema_max_rwlock_instances | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 1000 | ||
The maximum number of instrumented rwlock objects.
performance_schema_max_table_handles
| Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_table_handles=# | ||
| System Variable | Name | performance_schema_max_table_handles | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 100000 | ||
The maximum number of opened table objects.
performance_schema_max_table_instances
| Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_table_instances=# | ||
| System Variable | Name | performance_schema_max_table_instances | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 50000 | ||
The maximum number of instrumented table objects.
performance_schema_max_thread_classes
| Introduced | 5.5.3 | ||
| 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
| Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_thread_instances=# | ||
| System Variable | Name | performance_schema_max_thread_instances | |
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | Type | integer | |
| Default | 1000 | ||
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 and
max_delayed_threads system
variables affect how many threads are run in the server.
performance_schema_max_thread_instances
affects how many of these running threads can be instrumented.
If you increase
max_connections or
max_delayed_threads, you
should consider increasing
performance_schema_max_thread_instances
so that
performance_schema_max_thread_instances
is greater than the sum of
max_connections and
max_delayed_threads.