Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Monitoring Plugins:
* lynis-logfile: Reports how many tests the lynis profile skips.
* mysql-connections: Speaks of failed connection attempts instead of aborted connections, and points to the denied logins.
* mysql-index-health: Redundant indexes no longer alert by default.
* mysql-innodb-buffer-pool-size: No longer alerts just because the data is larger than the buffer pool.
* mysql-innodb-buffer-pool-size: No longer alerts just because the data is larger than the buffer pool, and warns when sessions found no free page in it.
* mysql-memory: Alerts on the memory the database server really uses, the calculated worst case and other processes no longer alert.
* mysql-perf-metrics: `innodb_snapshot_isolation` no longer alerts, and `--storage-type=auto` no longer judges virtual disks.
* mysql-temp-tables: No longer alerts by default, and no longer advises raising `tmp_table_size`.
Expand Down

Large diffs are not rendered by default.

86 changes: 69 additions & 17 deletions check-plugins/mysql-innodb-buffer-pool-size/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ spec:
min: 0
unit: bytes
overrides:
- matcher:
id: byName
options: mysql_innodb_buffer_pool_bytes_data
properties:
- id: displayName
value: Data in the buffer pool
- matcher:
id: byName
options: mysql_innodb_buffer_pool_size
Expand Down Expand Up @@ -140,6 +146,36 @@ spec:
operator: '='
value: mysql_innodb_buffer_pool_size

- alias: mysql_innodb_buffer_pool_bytes_data
refId: mysql_innodb_buffer_pool_bytes_data
groupBy:
- params:
- $interval
type: time
- params:
- 'null'
type: fill
measurement: $command
resultFormat: time_series
select:
- - params:
- value
type: field
- params: []
type: mean
tags:
- key: hostname
operator: '='
value: $hostname
- condition: AND
key: service
operator: '='
value: $service
- condition: AND
key: metric
operator: '='
value: mysql_innodb_buffer_pool_bytes_data

- alias: mysql_innodb_data_size
refId: mysql_innodb_data_size
groupBy:
Expand Down Expand Up @@ -564,3 +600,79 @@ spec:
key: metric
operator: '='
value: mysql_innodb_buffer_pool_wait_free_per_second

- title: MySQL InnoDB Buffer Pool - Usage
type: timeseries
gridPos:
h: 8
w: 12
x: 0
y: 16
fieldConfig:
defaults:
color:
mode: palette-classic
custom:
drawStyle: line
lineInterpolation: smooth
lineWidth: 1
pointSize: 3
showPoints: always
spanNulls: 900000
decimals: 1
max: 100
min: 0
unit: percent
overrides:
- matcher:
id: byName
options: mysql_innodb_buffer_pool_pct_used
properties:
- id: displayName
value: Buffer pool pages in use
options:
legend:
calcs:
- firstNotNull
- min
- mean
- max
- lastNotNull
displayMode: table
placement: bottom
showLegend: true
tooltip:
mode: multi
sort: none

targets:

- alias: mysql_innodb_buffer_pool_pct_used
refId: mysql_innodb_buffer_pool_pct_used
groupBy:
- params:
- $interval
type: time
- params:
- 'null'
type: fill
measurement: $command
resultFormat: time_series
select:
- - params:
- value
type: field
- params: []
type: mean
tags:
- key: hostname
operator: '='
value: $hostname
- condition: AND
key: service
operator: '='
value: $service
- condition: AND
key: metric
operator: '='
value: mysql_innodb_buffer_pool_pct_used
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
},
"--warning-miss-ratio": {
"value": "$mysql_innodb_buffer_pool_size_warning_miss_ratio$"
},
"--warning-waits": {
"value": "$mysql_innodb_buffer_pool_size_warning_waits$"
}
},
"command": "/usr/lib64/nagios/plugins/mysql-innodb-buffer-pool-size",
Expand Down Expand Up @@ -69,6 +72,11 @@
"datafield_id": 8,
"is_required": "n",
"var_filter": null
},
{
"datafield_id": 9,
"is_required": "n",
"var_filter": null
}
],
"imports": [],
Expand Down Expand Up @@ -112,7 +120,7 @@
"tpl-service-generic"
],
"max_check_attempts": 5,
"notes": "Checks the InnoDB buffer pool and redo log sizing in MySQL/MariaDB. Measures how many of the pages InnoDB requested since the last check had to be read from disk because they were not in the buffer pool, and reports how far the checkpoint has run through the redo log, which is what tells a redo log that is too small for its workload from one that is merely small. The buffer pool does not have to hold the whole database: InnoDB keeps the pages that are read again and lets pages from a one-off scan age out first, so a pool far smaller than the data is fine as long as the working set fits. The InnoDB data and index size is therefore reported for reference only and never raises a state. Pages InnoDB prefetches by read-ahead are not counted as misses, and fewer than 10 misses per second are not worth an alert on any storage. On MariaDB 11.4.9 and newer the page requests of a transaction are only counted once it ends, so while long transactions run, the miss ratio of a single check can read too high, or cannot be computed at all when more pages were read than requested. On a server that publishes `Innodb_checkpoint_age` and `Innodb_checkpoint_max_age` those decide the state; on one that publishes neither, the average redo write rate since startup is compared against the redo log size instead, and a workload that writes through the whole log within an hour is reported. The redo log knob is `innodb_redo_log_capacity` on MySQL 8.0.30+ and `innodb_log_file_size` (times `innodb_log_files_in_group`, where that variable still exists) on MariaDB and older MySQL. Also flags `innodb_file_per_table = OFF` and architecture-related buffer-pool size limits. Alerts if the buffer pool miss ratio exceeds its threshold, or if the checkpoint runs closer to the end of the redo log than the thresholds allow. The redo log size mysqltuner would recommend for the host's RAM is reported as advice without raising a state, because it is a floor for the RAM tier rather than a measurement of this server. On freshly booted servers (less than one hour of uptime) the write-rate comparison is deferred, because the rate is an average since startup and not yet meaningful.",
"notes": "Checks the InnoDB buffer pool and redo log sizing in MySQL/MariaDB. Measures how many of the pages InnoDB requested since the last check had to be read from disk because they were not in the buffer pool, and reports how far the checkpoint has run through the redo log, which is what tells a redo log that is too small for its workload from one that is merely small. The buffer pool does not have to hold the whole database: InnoDB keeps the pages that are read again and lets pages from a one-off scan age out first, so a pool far smaller than the data is fine as long as the working set fits. The InnoDB data and index size is therefore reported for reference only and never raises a state. Pages InnoDB prefetches by read-ahead are not counted as misses, and fewer than 10 misses per second are not worth an alert on any storage. On MariaDB 11.4.9 and newer the page requests of a transaction are only counted once it ends, so while long transactions run, the miss ratio of a single check can read too high, or cannot be computed at all when more pages were read than requested. On a server that publishes `Innodb_checkpoint_age` and `Innodb_checkpoint_max_age` those decide the state; on one that publishes neither, the average redo write rate since startup is compared against the redo log size instead, and a workload that writes through the whole log within an hour is reported. The redo log knob is `innodb_redo_log_capacity` on MySQL 8.0.30+ and `innodb_log_file_size` (times `innodb_log_files_in_group`, where that variable still exists) on MariaDB and older MySQL. Also flags `innodb_file_per_table = OFF` and architecture-related buffer-pool size limits. Also reports how much of the buffer pool is in use; a pool that is not full yet is still filling up after a restart, and a low value is no reason to shrink it. Alerts if the buffer pool miss ratio exceeds its threshold, if sessions found no free page in the buffer pool more often than `--warning-waits` allows (default: at all), or if the checkpoint runs closer to the end of the redo log than the thresholds allow. The redo log size mysqltuner would recommend for the host's RAM is reported as advice without raising a state, because it is a floor for the RAM tier rather than a measurement of this server. On freshly booted servers (less than one hour of uptime) the write-rate comparison is deferred, because the rate is an average since startup and not yet meaningful.",
"notes_url": "https://linuxfabrik.github.io/monitoring-plugins/check-plugins/mysql-innodb-buffer-pool-size/",
"object_name": "tpl-service-mysql-innodb-buffer-pool-size",
"object_type": "template",
Expand All @@ -130,7 +138,8 @@
"mysql_innodb_buffer_pool_size_no_perfdata": false,
"mysql_innodb_buffer_pool_size_timeout": 3,
"mysql_innodb_buffer_pool_size_warning": "87.5",
"mysql_innodb_buffer_pool_size_warning_miss_ratio": "20"
"mysql_innodb_buffer_pool_size_warning_miss_ratio": "20",
"mysql_innodb_buffer_pool_size_warning_waits": "0"
},
"volatile": null,
"zone": null,
Expand Down Expand Up @@ -221,6 +230,17 @@
"visibility": "visible"
},
"uuid": "d7a4836d-7c43-4d57-b932-359de134005b"
},
"9": {
"varname": "mysql_innodb_buffer_pool_size_warning_waits",
"caption": "MySQL Innodb Buffer Pool Size: Warning Waits",
"description": "WARN threshold for the times per second a session found no free page in the buffer pool. Raise it where bulk loads are allowed to run into this. Supports Nagios ranges. Example: `--warning-waits=5`.",
"datatype": "Icinga\\Module\\Director\\DataType\\DataTypeString",
"format": null,
"settings": {
"visibility": "visible"
},
"uuid": "68247b09-17ae-414b-b1a8-8e2117c33611"
}
}
}
Loading
Loading