[Feat]: carts for mariadb circular buffers
ekexcello opened this issue · 0 comments
Problem
We use mariadb with galera. To investigate and tune it's state transfre capability, we need to track utilization of two circular buffers, namely Gcache and Redo log (innodb_log). We need to know how much history buffers are able to hold in our setup.
Description
As buffers are circular, they act like LIFO, so once the buffer is completely utilized, adding new data purges oldest records.
For each buffer we would need three charts:
- circular buffer size
- total amount of bytes written into the buffer
- time since the moment the buffer is completely utilized first since mariadbd start-up.
In order not to overload mariadb with reading parameters, it's enough to have these values checked once a minute.
At the moment Netdata already collects wsrep_replicated_bytes per-second delta (shown on chart mysql.galera_bytes
and Innodb log buffer per-second delta is present in mysql.innodb_io
, but we need absolute values also.
Importance
really want
Value proposition
- For Gcache:
- buffer size on disk
- amount of replicated data
- time since first overflow
- For Innodb log buffer:
- buffer size on disk
- amount of data written
- time since first overflow
Proposed implementation
- For gcache buffer:
- size can be obtained as a field
gcache.keep_pages_size
from thewsrep_provider_options
variable (that can be read asSHOW VARIABLES LIKE 'wsrep_provider_options'\G
). - amount of replicated data can be obtained from
SHOW STATUS LIKE 'wsrep_replicated_bytes';
output directly. - time since first overflow is 0 until the moment of (
wsrep_replicated_bytes = gcache.keep_pages_size
), than it should be the difference between that moment and current time.
- For Innodb log buffer:
- size can be read from system variable
SHOW STATUS LIKE 'innodb_log_file_size';
directly - amount of written data can be read from system variable
SHOW STATUS LIKE 'Innodb_os_log_written';
- time since first overflow is 0 until the moment of (
innodb_log_file_size = Innodb_os_log_written
), than it should be the difference between that moment and current time.