Galera Cluster node send queue
Job details
Name: | Galera Cluster node send queue |
Platform: | Mariadb |
Category: | Cluster and Replication |
Description: | Checks current length of the send queue, which is the number of writesets waiting to be sent. |
Long description: | Checks current length of the send queue, which is the number of writesets waiting to be sent. |
Version: | 1.1 |
Default schedule: | 2,12,22,32,42,52 * * * |
Requires engine install: | Yes |
Compatibility tag: | .[type=‘instance’ & is_mariadb_branch=‘1′]/.[hasengine=‘YES’ & use_global_variables_information_schema = ‘1′ & wsrep_cluster != ‘0′] |
Parameters
Name | Default value | Description |
---|---|---|
warning threshold | 20 | The maximum value of queue length before a warning is triggered. |
alarm threshold | 100 | The maximum value of queue length before an alarm is triggered. |
enable warnings and alarms | NO | If set to “NO”, the alert will only collect statistics without returning status warning or alarm. Value “YES“ will activate the alert. |
history threshold | 7 | The maximum number of day to kept statistics for in the historic tables. |
Job Summary
- Purpose: The purpose of this job is to monitor the length of the send queue in a MariaDB Galera Cluster, which indicates the number of writesets that are waiting to be sent to other nodes.
- Why: This job is important because a high send queue length can indicate replication lag or network issues within the cluster. Monitoring this metric helps in maintaining the performance and reliability of the cluster. If the queue length crosses predefined thresholds, it can trigger warnings or alarms, prompting timely intervention.
- Manual checking: You can check this manually in the database by issuing this SQL command:
SELECT VARIABLE_VALUE AS 'Send Queue Length' FROM information_schema.global_status WHERE variable_name = 'wsrep_local_send_queue';
Implementation Details
The monitoring job works by executing several SQL statements and procedures to manage and record send queue data:
- “Create table” and “alter table” statements to prepare the database schema for storing send queue data.
- A procedure is implemented to periodically check the send queue length and compare it against the set thresholds for warning and alarm.
- An insert statement populates the send queue length into a historical tracking table.
- Cleanup activities include removing old data beyond a configurable historical threshold and dropping necessary tables and procedures in case of failures.
Reporting
The job includes a reporting template that presents:
- Historical send queue data visualization over time.
- Tables and charts that are generated based on the collected data:
Column | Description |
---|---|
Send Queue | Number of writesets waiting to be sent |
History Date | Date and time when the measurement was taken |
Dependency Management
Dependencies include:
- Maintenance of primary and historical tables.
- A procedure for updating check values derived from the send queue length.
Configuration and Customization
- Alerts can be turned off or on, controlling whether conditions are checked actively and if warnings or alarms are raised.
- Warning and alarm thresholds can be set to specific values as preferred.
- Historical data trimming is configurable by setting the number of days to keep records.
Operational Schedules
- The job is scheduled to run at intervals throughout the hour, ensuring that data is frequently updated and any critical changes in the send queue are promptly addressed.
This setup assures that database administrators have timely and relevant data to manage the Galera Cluster effectively, reducing the potential impact of cluster performance issues.