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 21.8, “Performance Schema Option and Variable Reference”.
Performance Schema variables have the following meanings:
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema=# | ||
| Option-File Format | performance_schema=# | ||
| Variable Name | performance_schema | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
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
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_events_waits_history_long_size=# | ||
| Option-File Format | performance_schema_events_waits_history_long_size=# | ||
| Variable Name | performance_schema_events_waits_history_long_size | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
The number of rows in the
events_waits_history_long table.
performance_schema_events_waits_history_size
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_events_waits_history_size=# | ||
| Option-File Format | performance_schema_events_waits_history_size=# | ||
| Variable Name | performance_schema_events_waits_history_size | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
The number of rows per thread in the
events_waits_history table.
performance_schema_max_cond_classes
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_cond_classes=# | ||
| Option-File Format | performance_schema_max_cond_classes=# | ||
| Variable Name | performance_schema_max_cond_classes | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 80 | ||
The maximum number of condition instruments.
performance_schema_max_cond_instances
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_cond_instances=# | ||
| Option-File Format | performance_schema_max_cond_instances=# | ||
| Variable Name | performance_schema_max_cond_instances | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
The maximum number of instrumented condition objects.
performance_schema_max_file_classes
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_file_classes=# | ||
| Option-File Format | performance_schema_max_file_classes=# | ||
| Variable Name | performance_schema_max_file_classes | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 50 | ||
The maximum number of file instruments.
performance_schema_max_file_handles
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_file_handles=# | ||
| Option-File Format | performance_schema_max_file_handles=# | ||
| Variable Name | performance_schema_max_file_handles | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| 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
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_file_instances=# | ||
| Option-File Format | performance_schema_max_file_instances=# | ||
| Variable Name | performance_schema_max_file_instances | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
The maximum number of instrumented file objects.
performance_schema_max_mutex_classes
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_mutex_classes=# | ||
| Option-File Format | performance_schema_max_mutex_classes=# | ||
| Variable Name | performance_schema_max_mutex_classes | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 200 | ||
The maximum number of mutex instruments.
performance_schema_max_mutex_instances
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_mutex_instances=# | ||
| Option-File Format | performance_schema_max_mutex_instances=# | ||
| Variable Name | performance_schema_max_mutex_instances | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
The maximum number of instrumented mutex objects.
performance_schema_max_rwlock_classes
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_rwlock_classes=# | ||
| Option-File Format | performance_schema_max_rwlock_classes=# | ||
| Variable Name | performance_schema_max_rwlock_classes | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 20 | ||
The maximum number of rwlock instruments.
performance_schema_max_rwlock_instances
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_rwlock_instances=# | ||
| Option-File Format | performance_schema_max_rwlock_instances=# | ||
| Variable Name | performance_schema_max_rwlock_instances | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
The maximum number of instrumented rwlock objects.
performance_schema_max_table_handles
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_table_handles=# | ||
| Option-File Format | performance_schema_max_table_handles=# | ||
| Variable Name | performance_schema_max_table_handles | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
The maximum number of opened table objects.
performance_schema_max_table_instances
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_table_instances=# | ||
| Option-File Format | performance_schema_max_table_instances=# | ||
| Variable Name | performance_schema_max_table_instances | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
The maximum number of instrumented table objects.
performance_schema_max_thread_classes
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_thread_classes=# | ||
| Option-File Format | performance_schema_max_thread_classes=# | ||
| Variable Name | performance_schema_max_thread_classes | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
| Permitted Values | |||
| Type | numeric | ||
| Default | 50 | ||
The maximum number of thread instruments.
performance_schema_max_thread_instances
| Version Introduced | 5.5.3 | ||
| Command-Line Format | --performance_schema_max_thread_instances=# | ||
| Option-File Format | performance_schema_max_thread_instances=# | ||
| Variable Name | performance_schema_max_thread_instances | ||
| Variable Scope | Global | ||
| Dynamic Variable | No | ||
The maximum number of instrumented thread objects.
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.

User Comments
Add your own comment.