List:Commits« Previous MessageNext Message »
From:Marc Alff Date:March 23 2009 5:34pm
Subject:Re: [Fwd: Review of the performance schema instrumentation interface
View as plain text  
Hi Guilhem & All

Guilhem Bichot wrote:
> Hi Marc,
> 
> You once explained that the data used by the Perf Schema is all-static,
> allocated at startup. What happens if, after startup, a client does
> "INSTALL PLUGIN a_plugin;"
> and this plugin features your instrumentation?
> Will the plugin's instrumented data be properly reported, or ignored?
> Does a concurrent SELECT from the Perf Schema risk reading something wrong?
> What about UNINSTALL PLUGIN?
> 

Let's assume that the server has room for 200 mutex instruments, for
example because it was started with:

./mysqld --performance-schema-max-mutex-instruments=200

Let's assume 150 mutex instruments have been loaded already.

Let's assume "a_plugin" contains 40 mutex instruments.
Let's assume "b_plugin" contains 20 mutex instruments.

INSTALL PLUGIN a_plugin
--> the server now has 150+40 = 190 mutex instruments.

UNINSTALL PLUGIN a_plugin
--> the server still has 190 instruments
All the historical data generated by the plugin code is still available

INSTALL PLUGIN a_plugin
--> the server detect that the 40 instruments are already defined,
so no new instrument is created, and previous assigned keys are re-used.
--> the server still has 190 instruments

INSTALL PLUGIN b_plugin
--> the server has room for 200-190 = 10, and sees 20 new instruments.
10 instruments are loaded, 10 are discarded or "lost".

The instrumentation still works and collects (partial) data for plugin
B. Select from the performance schema also works.

In this example, the performance schema variables and status will look
like this:


mysql> show variables like "%perf%";
+---------------------------------------------------+--------+
| Variable_name                                     | Value  |
+---------------------------------------------------+--------+
| performance_schema_enabled                        | ON     |
| performance_schema_events_waits_history_long_size | 10000  |
| performance_schema_events_waits_history_size      | 10     |
| performance_schema_max_cond                       | 1000   |
| performance_schema_max_cond_instruments           | 80     |
| performance_schema_max_file                       | 1000   |
| performance_schema_max_file_instruments           | 50     |
| performance_schema_max_mutex                      | 1000   |
| performance_schema_max_mutex_instruments          | 200    | <-- here
| performance_schema_max_rwlock                     | 1000   |
| performance_schema_max_rwlock_instruments         | 20     |
| performance_schema_max_table                      | 100000 |
| performance_schema_max_table_instruments          | 50000  |
| performance_schema_max_thread                     | 1000   |
| performance_schema_max_thread_instruments         | 50     |
+---------------------------------------------------+--------+
15 rows in set (0.03 sec)


mysql> show status like "%perf%";
+-------------------------------------------+-------+
| Variable_name                             | Value |
+-------------------------------------------+-------+
| Performance_schema_cond_instrument_lost   | 0     |
| Performance_schema_cond_lost              | 0     |
| Performance_schema_file_instrument_lost   | 0     |
| Performance_schema_file_lost              | 0     |
| Performance_schema_mutex_instrument_lost  | 0     |
| Performance_schema_mutex_lost             | 10    | <-- here
| Performance_schema_rwlock_instrument_lost | 0     |
| Performance_schema_rwlock_lost            | 0     |
| Performance_schema_table_instrument_lost  | 0     |
| Performance_schema_table_lost             | 0     |
| Performance_schema_thread_instrument_lost | 0     |
| Performance_schema_thread_lost            | 0     |
+-------------------------------------------+-------+
12 rows in set (0.01 sec)


At any given time, the instrumentation collecting data is safe.
At any given time, doing a SELECT from P_S.* is safe.

This pattern applies to all types of instruments, not just mutexes.

Regards,
-- Marc


Thread
[Fwd: Review of the performance schema instrumentation interface (was:moins de remplacements)]Marc Alff19 Mar
  • Re: [Fwd: Review of the performance schema instrumentation interface(was: moins de remplacements)]Guilhem Bichot23 Mar
    • Re: [Fwd: Review of the performance schema instrumentation interfaceMarc Alff23 Mar
      • Re: [Fwd: Review of the performance schema instrumentation interfaceGuilhem Bichot7 Apr
        • Re: [Fwd: Review of the performance schema instrumentation interfaceMarc Alff7 Apr
          • Re: [Fwd: Review of the performance schema instrumentation interfaceGuilhem Bichot7 Apr
            • Re: [Fwd: Review of the performance schema instrumentation interfaceMarc Alff7 Apr
              • Re: [Fwd: Review of the performance schema instrumentation interfaceGuilhem Bichot8 Apr
                • Re: [Fwd: Review of the performance schema instrumentation interfaceMarc Alff20 Jun
  • Instrumenting Maria system threads Re: [Fwd: Review of the performanceschema instrumentation interface (was: moins de remplacements)]Guilhem Bichot23 Mar
  • Re: Review of the performance schema instrumentation interfaceSergei Golubchik10 Apr
    • Re: Review of the performance schema instrumentation interfaceMichael Widenius13 Apr