replication-manager can collect advanced metrics from MySQL/MariaDB Performance Schema, including mutex waits, latch (rwlock) waits, and memory usage. These metrics are collected during each monitoring loop and exported to Graphite for trending analysis.
monitoring-performance-schema (2.0)| Item | Value |
|---|---|
| Description | Enable Performance Schema monitoring |
| Type | boolean |
| Default Value | true |
When enabled, replication-manager queries Performance Schema tables to collect query statistics and performance metrics.
monitoring-performance-schema-instruments (2.0)| Item | Value |
|---|---|
| Description | Monitor Performance Schema instruments configuration |
| Type | boolean |
| Default Value | true |
Monitors the enabled/disabled state of Performance Schema instruments from setup_instruments table.
monitoring-performance-schema-mutex (3.1)| Item | Value |
|---|---|
| Description | Monitor InnoDB mutex wait events |
| Type | boolean |
| Default Value | true |
When enabled, replication-manager collects mutex wait statistics from Performance Schema and includes them in global status metrics sent to Graphite.
Data collected:
performance_schema.events_waits_summary_global_by_event_nameEVENT_NAME LIKE 'wait/synch/mutex/innodb%'COUNT_STAR for each mutex eventWAIT_SYNCH_MUTEX_INNODB_*Use cases:
Requirements:
performance_schema = ON)monitoring-performance-schema-latch (3.1)| Item | Value |
|---|---|
| Description | Monitor InnoDB latch (rwlock) wait events |
| Type | boolean |
| Default Value | true |
When enabled, replication-manager collects read-write lock (rwlock) wait statistics from Performance Schema and includes them in global status metrics sent to Graphite.
Data collected:
performance_schema.events_waits_summary_global_by_event_nameEVENT_NAME LIKE 'wait/synch/rwlock/innodb%'COUNT_STAR for each rwlock eventWAIT_SYNCH_RWLOCK_INNODB_*Use cases:
Requirements:
performance_schema = ON)monitoring-performance-schema-memory (3.1)| Item | Value |
|---|---|
| Description | Monitor Performance Schema memory usage |
| Type | boolean |
| Default Value | true |
When enabled, replication-manager collects memory usage statistics from Performance Schema memory instrumentation and includes them in global status metrics sent to Graphite.
Data collected:
performance_schema.memory_summary_global_by_event_nameCURRENT_COUNT_USED, CURRENT_NUMBER_OF_BYTES_USED, HIGH_COUNT_USED, HIGH_NUMBER_OF_BYTES_USEDUse cases:
Requirements:
performance_schema = ON)To enable all Performance Schema advanced monitoring features:
monitoring-performance-schema = true
monitoring-performance-schema-instruments = true
monitoring-performance-schema-mutex = true
monitoring-performance-schema-latch = true
monitoring-performance-schema-memory = true
To disable mutex/latch monitoring but keep memory monitoring:
monitoring-performance-schema = true
monitoring-performance-schema-mutex = false
monitoring-performance-schema-latch = false
monitoring-performance-schema-memory = true
When these features are enabled, replication-manager adds the collected metrics to the global status query result. Metrics are then:
Metric naming convention:
mysql.{server_id}.mysql_global_status_wait_synch_mutex_innodb_{event}mysql.{server_id}.mysql_global_status_wait_synch_rwlock_innodb_{event}mysql.{server_id}.mysql_global_status_memory_{event}Impact:
Recommendations:
Ensure Performance Schema is properly configured in your database server:
# Enable Performance Schema
performance_schema = ON
# Enable wait event instruments (for mutex/latch monitoring)
performance-schema-instrument = 'wait/synch/%=ON'
# Enable memory instruments (for memory monitoring)
performance-schema-instrument = 'memory/%=ON'
# Enable consumers
performance-schema-consumer-events-waits-current = ON
performance-schema-consumer-events-waits-history = ON
performance-schema-consumer-events-waits-history-long = ON
Metrics not appearing:
SHOW VARIABLES LIKE 'performance_schema'SELECT * FROM performance_schema.setup_instruments WHERE NAME LIKE 'wait/synch/%'graphite-metrics = true or Prometheus endpoint is configuredHigh monitoring overhead:
monitoring-wait-retry intervalNo mutex/latch events:
COUNT_STAR = 0 for all events, there is genuinely no wait contention