Example Consumer Configurations
The consumer settings in the setup_consumers
table form a hierarchy from higher levels to lower. The following discussion describes how consumers work, showing specific configurations and their effects as consumer settings are enabled progressively from high to low. The consumer values shown are representative. The general principles described here apply to other consumer values that may be available.
The configuration descriptions occur in order of increasing functionality and overhead. If you do not need the information provided by enabling lower-level settings, disable them and the Performance Schema will execute less code on your behalf and you will have less information to sift through.
Suppose that the setup_consumers
table contains the following hierarchy of values:
global_instrumentation thread_instrumentation events_waits_current events_waits_history events_waits_history_long
If a given consumer setting is NO
, the Performance Schema disables the instrumentation associated with the consumer and ignores all lower-level settings. If a given setting is YES
, the Performance Schema enables the instrumentation associated with it and checks the settings at the next lowest level.
Each configuration description indicates which setup elements the Performance Schema checks and which output tables it maintains (that is, for which tables it collects information).No Instrumentation
Server configuration state:
mysql> SELECT * FROM setup_consumers;
+---------------------------+---------+
| NAME | ENABLED |
+---------------------------+---------+
| global_instrumentation | NO |
...
+---------------------------+---------+
In this configuration, nothing is instrumented.
Setup elements checked:
- Table
setup_consumers
, consumerglobal_instrumentation
Output tables maintained:
- None
Server configuration state:
mysql> SELECT * FROM setup_consumers;
+---------------------------+---------+
| NAME | ENABLED |
+---------------------------+---------+
| global_instrumentation | YES |
| thread_instrumentation | NO |
...
+---------------------------+---------+
In this configuration, instrumentation is maintained only for global states. Per-thread instrumentation is disabled.
Additional setup elements checked, relative to the preceding configuration:
- Table
setup_consumers
, consumerthread_instrumentation
- Table
setup_instruments
- Table
setup_objects
- Table
setup_timers
Additional output tables maintained, relative to the preceding configuration:
mutex_instances
rwlock_instances
cond_instances
file_instances
file_summary_by_instance
file_summary_by_event_name
objects_summary_global_by_type
table_lock_waits_summary_by_table
table_io_waits_summary_by_index_usage
table_io_waits_summary_by_table
events_waits_summary_by_instance
events_waits_summary_global_by_event_name
Server configuration state:
mysql> SELECT * FROM setup_consumers;
+---------------------------+---------+
| NAME | ENABLED |
+---------------------------+---------+
| global_instrumentation | YES |
| thread_instrumentation | YES |
| events_waits_current | NO |
...
+---------------------------+---------+
In this configuration, instrumentation is maintained globally and per thread. No individual wait events are collected in the current-events or event-history tables.
Additional setup elements checked, relative to the preceding configuration:
- Table
setup_consumers
, consumerevents_waits_current
- Table
setup_actors
- Column
threads.instrumented
Additional output tables maintained, relative to the preceding configuration:
Global, Thread, and Current-Event InstrumentationServer configuration state:
mysql> SELECT * FROM setup_consumers;
+---------------------------+---------+
| NAME | ENABLED |
+---------------------------+---------+
| global_instrumentation | YES |
| thread_instrumentation | YES |
| events_waits_current | YES |
| events_waits_history | NO |
| events_waits_history_long | NO |
...
+---------------------------+---------+
In this configuration, instrumentation is maintained globally and per thread. Individual wait events are collected in the current-events table, but not in the event-history tables.
Additional setup elements checked, relative to the preceding configuration:
- Consumer
events_waits_history
- Consumer
events_waits_history_long
Additional output tables maintained, relative to the preceding configuration:
Global, Thread, Current-Event, and Event-History instrumentationThe preceding configuration collects no wait event history because the events_waits_history
and events_waits_history_long
consumers are disabled. Those consumers can be enabled separately or together to collect event history per thread, globally, or both.
This configuration collects event history per thread, but not globally:
mysql> SELECT * FROM setup_consumers;
+---------------------------+---------+
| NAME | ENABLED |
+---------------------------+---------+
| global_instrumentation | YES |
| thread_instrumentation | YES |
| events_waits_current | YES |
| events_waits_history | YES |
| events_waits_history_long | NO |
...
+---------------------------+---------+
Event-history tables maintained for this configuration:
This configuration collects event history globally, but not per thread:
mysql> SELECT * FROM setup_consumers;
+---------------------------+---------+
| NAME | ENABLED |
+---------------------------+---------+
| global_instrumentation | YES |
| thread_instrumentation | YES |
| events_waits_current | YES |
| events_waits_history | NO |
| events_waits_history_long | YES |
...
+---------------------------+---------+
Event-history tables maintained for this configuration:
This configuration collects event history per thread and globally:
mysql> SELECT * FROM setup_consumers;
+---------------------------+---------+
| NAME | ENABLED |
+---------------------------+---------+
| global_instrumentation | YES |
| thread_instrumentation | YES |
| events_waits_current | YES |
| events_waits_history | YES |
| events_waits_history_long | YES |
...
+---------------------------+---------+
Event-history tables maintained for this configuration: