Rechercher dans le manuel MySQL

26.4.8 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.

The setup_consumers table contains the following hierarchy of values:

global_instrumentation
 thread_instrumentation
   events_waits_current
     events_waits_history
     events_waits_history_long
   events_stages_current
     events_stages_history
     events_stages_history_long
   events_statements_current
     events_statements_history
     events_statements_history_long
   events_transactions_current
     events_transactions_history
     events_transactions_history_long
 statements_digest
Note

In the consumer hierarchy, the consumers for waits, stages, statements, and transactions are all at the same level. This differs from the event nesting hierarchy, for which wait events nest within stage events, which nest within statement events, which nest within transaction events.

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. For a description of the rules for each consumer, see Section 26.4.7, “Pre-Filtering by Consumer”.

For example, if global_instrumentation is enabled, thread_instrumentation is checked. If thread_instrumentation is enabled, the events_xxx_current consumers are checked. If of these events_waits_current is enabled, events_waits_history and events_waits_history_long are checked.

Each of the following configuration descriptions 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:

  1. mysql> SELECT * FROM performance_schema.setup_consumers;
  2. +---------------------------+---------+
  3. | NAME                      | ENABLED |
  4. +---------------------------+---------+
  5. | global_instrumentation    | NO      |
  6. ...
  7. +---------------------------+---------+

In this configuration, nothing is instrumented.

Setup elements checked:

Output tables maintained:

  • None

Inhaltsverzeichnis Haut

Global Instrumentation Only

Server configuration state:

  1. mysql> SELECT * FROM performance_schema.setup_consumers;
  2. +---------------------------+---------+
  3. | NAME                      | ENABLED |
  4. +---------------------------+---------+
  5. | global_instrumentation    | YES     |
  6. | thread_instrumentation    | NO      |
  7. ...
  8. +---------------------------+---------+

In this configuration, instrumentation is maintained only for global states. Per-thread instrumentation is disabled.

Additional setup elements checked, relative to the preceding configuration:

Additional output tables maintained, relative to the preceding configuration:

Inhaltsverzeichnis Haut

Global and Thread Instrumentation Only

Server configuration state:

  1. mysql> SELECT * FROM performance_schema.setup_consumers;
  2. +----------------------------------+---------+
  3. | NAME                             | ENABLED |
  4. +----------------------------------+---------+
  5. | global_instrumentation           | YES     |
  6. | thread_instrumentation           | YES     |
  7. | events_waits_current             | NO      |
  8. ...
  9. | events_stages_current            | NO      |
  10. ...
  11. | events_statements_current        | NO      |
  12. ...
  13. | events_transactions_current      | NO      |
  14. ...
  15. +----------------------------------+---------+

In this configuration, instrumentation is maintained globally and per thread. No individual events are collected in the current-events or event-history tables.

Additional setup elements checked, relative to the preceding configuration:

  • Table setup_consumers, consumers events_xxx_current, where xxx is waits, stages, statements, transactions

  • Table setup_actors

  • Column threads.instrumented

Additional output tables maintained, relative to the preceding configuration:

  • events_xxx_summary_by_yyy_by_event_name, where xxx is waits, stages, statements, transactions; and yyy is thread, user, host, account

Inhaltsverzeichnis Haut

Global, Thread, and Current-Event Instrumentation

Server configuration state:

  1. mysql> SELECT * FROM performance_schema.setup_consumers;
  2. +----------------------------------+---------+
  3. | NAME                             | ENABLED |
  4. +----------------------------------+---------+
  5. | global_instrumentation           | YES     |
  6. | thread_instrumentation           | YES     |
  7. | events_waits_current             | YES     |
  8. | events_waits_history             | NO      |
  9. | events_waits_history_long        | NO      |
  10. | events_stages_current            | YES     |
  11. | events_stages_history            | NO      |
  12. | events_stages_history_long       | NO      |
  13. | events_statements_current        | YES     |
  14. | events_statements_history        | NO      |
  15. | events_statements_history_long   | NO      |
  16. | events_transactions_current      | YES     |
  17. | events_transactions_history      | NO      |
  18. | events_transactions_history_long | NO      |
  19. ...
  20. +----------------------------------+---------+

In this configuration, instrumentation is maintained globally and per thread. Individual events are collected in the current-events table, but not in the event-history tables.

Additional setup elements checked, relative to the preceding configuration:

  • Consumers events_xxx_history, where xxx is waits, stages, statements, transactions

  • Consumers events_xxx_history_long, where xxx is waits, stages, statements, transactions

Additional output tables maintained, relative to the preceding configuration:

  • events_xxx_current, where xxx is waits, stages, statements, transactions

Inhaltsverzeichnis Haut

Global, Thread, Current-Event, and Event-History instrumentation

The preceding configuration collects no event history because the events_xxx_history and events_xxx_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:

  1. mysql> SELECT * FROM performance_schema.setup_consumers;
  2. +----------------------------------+---------+
  3. | NAME                             | ENABLED |
  4. +----------------------------------+---------+
  5. | global_instrumentation           | YES     |
  6. | thread_instrumentation           | YES     |
  7. | events_waits_current             | YES     |
  8. | events_waits_history             | YES     |
  9. | events_waits_history_long        | NO      |
  10. | events_stages_current            | YES     |
  11. | events_stages_history            | YES     |
  12. | events_stages_history_long       | NO      |
  13. | events_statements_current        | YES     |
  14. | events_statements_history        | YES     |
  15. | events_statements_history_long   | NO      |
  16. | events_transactions_current      | YES     |
  17. | events_transactions_history      | YES     |
  18. | events_transactions_history_long | NO      |
  19. ...
  20. +----------------------------------+---------+

Event-history tables maintained for this configuration:

  • events_xxx_history, where xxx is waits, stages, statements, transactions

This configuration collects event history globally, but not per thread:

  1. mysql> SELECT * FROM performance_schema.setup_consumers;
  2. +----------------------------------+---------+
  3. | NAME                             | ENABLED |
  4. +----------------------------------+---------+
  5. | global_instrumentation           | YES     |
  6. | thread_instrumentation           | YES     |
  7. | events_waits_current             | YES     |
  8. | events_waits_history             | NO      |
  9. | events_waits_history_long        | YES     |
  10. | events_stages_current            | YES     |
  11. | events_stages_history            | NO      |
  12. | events_stages_history_long       | YES     |
  13. | events_statements_current        | YES     |
  14. | events_statements_history        | NO      |
  15. | events_statements_history_long   | YES     |
  16. | events_transactions_current      | YES     |
  17. | events_transactions_history      | NO      |
  18. | events_transactions_history_long | YES     |
  19. ...
  20. +----------------------------------+---------+

Event-history tables maintained for this configuration:

  • events_xxx_history_long, where xxx is waits, stages, statements, transactions

This configuration collects event history per thread and globally:

  1. mysql> SELECT * FROM performance_schema.setup_consumers;
  2. +----------------------------------+---------+
  3. | NAME                             | ENABLED |
  4. +----------------------------------+---------+
  5. | global_instrumentation           | YES     |
  6. | thread_instrumentation           | YES     |
  7. | events_waits_current             | YES     |
  8. | events_waits_history             | YES     |
  9. | events_waits_history_long        | YES     |
  10. | events_stages_current            | YES     |
  11. | events_stages_history            | YES     |
  12. | events_stages_history_long       | YES     |
  13. | events_statements_current        | YES     |
  14. | events_statements_history        | YES     |
  15. | events_statements_history_long   | YES     |
  16. | events_transactions_current      | YES     |
  17. | events_transactions_history      | YES     |
  18. | events_transactions_history_long | YES     |
  19. ...
  20. +----------------------------------+---------+

Event-history tables maintained for this configuration:

  • events_xxx_history, where xxx is waits, stages, statements, transactions

  • events_xxx_history_long, where xxx is waits, stages, statements, transactions


Suchen Sie im MySQL-Handbuch

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 26/06/2006, zuletzt geändert 26/10/2018
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/mysql-rf-performance-schema-consumer-configurations.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:en Manuel MySQL : https://dev.mysql.com/

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.

Inhaltsverzeichnis Haut