Binlog cache check


Job details

Name: Binlog cache check
Platform: Mariadb
Category: Performance
Description: Checks the number of transactions that used the temporary binary log cache but that exceeded the value of binlog_cache_size and used a temporary file to store statements from the transaction. Statistics collected from information_schema.global_status.
Long description: Checks the number of transactions that used the temporary binary log cache but that exceeded the value of binlog_cache_size and used a temporary file to store statements from the transaction.
Version: 2.32
Default schedule: 9,19,29,39,49,59 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & is_mariadb_branch=‘1′]/.[hasengine=‘YES’ & global_status_performance_schema = ‘0′ & global_status_information_schema = ‘1′ ]

Parameters

Name Default value Description
warning threshold 10 Will give a warning if the disk use exceeds this value. (in %)
alarm threshold 20 Will give an alarm if the disk use exceeds this value. (in %)
threshold (time) 30 A period of time (in minutes) which must be passed (combined with average values of BINLOG_CACHE_USE) before an alarm or a warning is returned by the procedure.
min BINLOG_CACHE_USE 100 The minimum average value of BINLOG_CACHE_USE per seconds (over a period of time defined by the [time threshold] parameter) before a warning or an alarm is triggered.
enable warnings and alarms NO If set to “NO” (default), 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

SELECT VARIABLE_NAME, VARIABLE_VALUE FROM information_schema.global_status WHERE VARIABLE_NAME IN ('BINLOG_CACHE_USE', 'BINLOG_CACHE_DISK_USE');

Implementation Details

This job involves several SQL structures and procedural operations to gather and analyze data:

  1. Tables:
    • ‘dbw_binlog_cache_check_histr’ stores historical data about cache usage and disk usage.
    • ‘dbw_binlog_cache_check_last’ temporarily holds the most recent data for comparison and update purposes.
  1. Procedures:
    • ‘dbw_binlog_cache_check’: Main procedure that calculates the ratio of disk use to cache use, updates the historical tables, and determines whether the current state triggers a warning or alarm based on pre-defined thresholds.
  1. Express Install and Force Install:
    • Both are set to true, suggesting that the job is crucial and must be maintained consistently across applicable systems.

Monitoring Logic

The core functionality involves:

Job Dependencies and Clean-up

Dependencies include:

Clean-up activities involve:

Reporting and Visualization

This monitoring job uses dbWatch report templates to provide visualizations and reports that can assist in evaluating the performance of the binary log cache over time. Key reports include:

Metric Visual Representation
Disk Use (%) Category Chart – History Date vs. Disk Use (%)
Total Cache Usage vs. Disk Usage # per sec., categorized by type over time

These reports are integral for DBAs to quickly assess and react to data trends, facilitating proactive management of database performance and capacity planning.